[PATCH] D42482: [ELF] - Support INSERT AFTER statement in linker script.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 07:33:54 PST 2018


grimar created this revision.
grimar added reviewers: ruiu, espindola.
Herald added a subscriber: emaste.

This is for PR35877.

Seems simple and isolated implementation. It remembers all sections
that are part of "INSERT AFTER" statement and makes them 
to be placed like orphans. That allows orphan placing code to find
and place such sections after regular common and regular orphans.

It looks to be consistent with spec which says:
(https://sourceware.org/binutils/docs/ld/Miscellaneous-Commands.html)
"It inserts all prior linker script statements after (or before) output_section, and also
causes ‘-T’ to not override the default linker script. The exact insertion point is as for
orphan sections.".

"INSERT AFTER" sections can't refer to each other in this implementation.
(it will not place them correctly). Though that does not look what was needed in original
PR request, so should be fine probably.


https://reviews.llvm.org/D42482

Files:
  ELF/LinkerScript.h
  ELF/ScriptParser.cpp
  ELF/Writer.cpp
  test/ELF/linkerscript/insert-after.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42482.131266.patch
Type: text/x-patch
Size: 3835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180124/33ce50fe/attachment.bin>


More information about the llvm-commits mailing list