[PATCH] D41082: [ELF] Change default output section type to SHT_NOBITS

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 11:36:29 PST 2017


jakehehrlich created this revision.
Herald added subscribers: javed.absar, emaste.

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.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41082

Files:
  ELF/LinkerScript.cpp
  ELF/OutputSections.cpp
  test/ELF/linkerscript/arm-exidx-order.s
  test/ELF/linkerscript/extend-pt-load.s
  test/ELF/linkerscript/merge-sections.s
  test/ELF/linkerscript/symbol-only-flags.s
  test/ELF/linkerscript/symbol-only.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41082.126413.patch
Type: text/x-patch
Size: 3971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171211/ed2c7ee8/attachment.bin>


More information about the llvm-commits mailing list