[PATCH] D33239: [LLD][ELF] Make SHF_LINK_ORDER section ordering use InputSectionDescriptions

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 07:28:14 PDT 2017


peter.smith created this revision.
Herald added subscribers: rengolin, aemerson.

This change moves the SHF_LINK_ORDER processing forward and makes it run on InputSectionDescriptions::Sections rather than OutputSections.

- The .ARM.exidx sentinel section is added as an InputSection if there is at least one .ARM.exidx section present. It will be added to the linker script with the other .ARM.exidx sections.
- The sorting of the SHF_LINK_ORDER sections and writing of the sentinel section contents now accounts for the section not always guaranteed last.
- The sorting of the SHF_LINK_ORDER is moved to LinkerScript
- The fabricated linker script commands are moved as far forward as possible

This is a step towards removing the need for the late LinkerScript::synchronize() function. It cannot be removed completely until Thunks are inserted directly into InputSectionDescriptions.

The current implementation of fabricateDefaultCommands() is moved up as far it can be with its current implementation. To move it further up we would need to split out the parts that rely on the program headers.


https://reviews.llvm.org/D33239

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/OutputSections.cpp
  ELF/SyntheticSections.cpp
  ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33239.99138.patch
Type: text/x-patch
Size: 9250 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170516/03a8b287/attachment.bin>


More information about the llvm-commits mailing list