[PATCH] D111717: [ELF] Avoid adding orphan sections to a less fit segment

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 08:00:09 PDT 2021


ikudrin created this revision.
ikudrin added reviewers: MaskRay, peter.smith.
ikudrin added projects: lld, LLVM.
Herald added subscribers: arichardson, emaste.
ikudrin requested review of this revision.

This is an alternative for D111137 <https://reviews.llvm.org/D111137>.

If segments are defined in a linker script, placing an orphan section before the found closest-rank section can result in adding it in a previous segment and changing flags of that segment. This happens if the orphan section has a lower sort rank than the found section. To avoid that, the patch forces orphan sections to be moved after the found sections if segments are explicitly defined.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111717

Files:
  lld/ELF/Writer.cpp
  lld/test/ELF/aarch64-thunk-pi.s
  lld/test/ELF/linkerscript/implicit-program-header.test
  lld/test/ELF/linkerscript/orphan-phdrs2.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111717.379382.patch
Type: text/x-patch
Size: 6090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211013/e71a380a/attachment.bin>


More information about the llvm-commits mailing list