[ELF] - Implement --orphan-handling option.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 25 Oct 2017 15:20:30 +0000 (15:20 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 25 Oct 2017 15:20:30 +0000 (15:20 +0000)
commit9814d151361a73477143304140696d4a94c0738f
tree1f74c3d4a1bbaaaa052bc356cc7df8e74d0aacda
parent925ddf1a93d25fb11452d8e08042a2a9f5337e78
[ELF] - Implement --orphan-handling option.

It is PR34946.

Spec (http://man7.org/linux/man-pages/man1/ld.1.html) tells about
--orphan-handling=MODE, option where MODE can be one of four:
"place", "discard", "warn", "error".
Currently we already report orphans when -verbose given,
what becomes excessive with option implemented.

Patch stops reporting orphans when -versbose is given,
and support "place", "warn" and "error" modes.
It is not yet clear that "discard" mode is useful so it is not supported.

Differential revision: https://reviews.llvm.org/D39000

llvm-svn: 316583
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/LinkerScript.cpp
lld/ELF/Options.td
lld/test/ELF/linkerscript/orphan-report.s