[PATCH] D77007: [ELF] Allow SHF_LINK_ORDER and non-SHF_LINK_ORDER to be mixed

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 09:10:56 PDT 2020


psmith accepted this revision.
psmith added a comment.
This revision is now accepted and ready to land.

I agree that there is no reason not to support the mixing of SHF_LINK_ORDER and non SHF_LINK_ORDER in the same OutputSection. Arm's proprietary linker will handle .ARM.exidx that way, I believe that a separate OutputSection is used in GNU ld and LLD as it simplifies the generation of Linker Generated Symbols that the library uses to find the tables.

Strictly speaking I don't think that there is anything in the ELF spec that requires that SHF_LINK_ORDER sections be contiguous.

  This flag adds special ordering requirements for link editors. The requirements apply if the sh_link field of this section's header references another section (the linked-to section). If this section is combined with other sections in the output file, it must appear in the same relative order with respect to those sections, as the linked-to section appears with respect to sections the linked-to section is combined with. 

In all current uses of SHF_LINK_ORDER like .ARM.exidx there has been a requirement for the sections to be contiguous on top of the requirements of the ELF specification so I'm happy to keep the diagnostic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77007/new/

https://reviews.llvm.org/D77007





More information about the llvm-commits mailing list