[ELF] - Do not collect SHT_REL[A] sections unconditionally when --gc-sections and...
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 24 Oct 2017 08:26:32 +0000 (08:26 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 24 Oct 2017 08:26:32 +0000 (08:26 +0000)
commitf4ca4a6fa147507ead2d10490af68c6adab898c8
tree1ae55870ea6c1de9cfdb5a892a32e0d0ad48ece4
parentefd5177d5e0f190902b9a0107a2cef2b805cafa5
[ELF] - Do not collect SHT_REL[A] sections unconditionally when --gc-sections and --emit-relocs used together.

This is "Bug 34836 - --gc-sections remove relocations from --emit-relocs",

When --emit-relocs is used, LLD currently always drops SHT_REL[A] sections from
output if --gc-sections is present. Patch fixes the issue.

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

llvm-svn: 316418
lld/ELF/InputSection.h
lld/ELF/MarkLive.cpp
lld/test/ELF/emit-relocs-gc.s