When an output section has no byte commands and has no input sections then it would be ideal if the type of the section is SHT_NOBITS so that the file can take up less space. This change sets the default type of of output sections to SHT_NOBITS instead of SHT_PROGBITS to allow this. This required some minor test changes (which double as tests for this new behavior) but extend-pt-load.s had be changed in a non-trivial way. Since it seems to me that the point of the test is to point out the consequences of how flags are assigned to output sections that don't have input sections I changed the test to work and still show how the memsize of the executable segment was changed.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM. Nice!
ELF/OutputSections.cpp | ||
---|---|---|
315–318 ↗ | (On Diff #126413) | You are not using Data so it should be if (isa<ByteCommand>(Base) && Type == SHT_NOBITS) Type = SHT_PROGBITS; |