[PATCH] D24725: [ELF] - Linkerscript: implemented --orphan-handling command line option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 06:02:39 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777, emaste.

Reviewing ld command line I found interesting option that seems to be usefull to have:
(https://sourceware.org/binutils/docs/ld/Options.html#Options)

--orphan-handling=MODE
Control how orphan sections are handled. An orphan section is one not specifically mentioned in a linker script. See Orphan Sections.
MODE can have any of the following values:

place
Orphan sections are placed into a suitable output section following the strategy described in Orphan Sections. The option `--unique' also effects how sections are placed. 
discard
All orphan sections are discarded, by placing them in the `/DISCARD/' section (see Output Section Discarding). 
warn
The linker will place the orphan section as for place and also issue a warning. 
error
The linker will exit with an error if any orphan section is found.
The default if `--orphan-handling' is not given is place.

Patch implements it.

https://reviews.llvm.org/D24725

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/Options.td
  test/ELF/linkerscript/orphan-handling.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24725.71818.patch
Type: text/x-patch
Size: 5813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160919/b87fb512/attachment.bin>


More information about the llvm-commits mailing list