[ELF] - Simplify removeUnusedSyntheticSections a bit.
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 25 Sep 2017 09:46:33 +0000 (09:46 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 25 Sep 2017 09:46:33 +0000 (09:46 +0000)
commit19d6ce9d8e2e587d4b5ef2b7b63b36203c5d66e8
tree63e3fad246c98cb3e081964e853242c87388b0cc
parent347c70d782732a365349f37ea03de0072d3326af
[ELF] - Simplify removeUnusedSyntheticSections a bit.

Previously`InX::Got` and InX::MipsGot synthetic sections
were not removed if ElfSym::GlobalOffsetTable was defined.
ElfSym::GlobalOffsetTable is a symbol for _GLOBAL_OFFSET_TABLE_.

Patch moves ElfSym::GlobalOffsetTable check out from removeUnusedSyntheticSections.
Also note that there was no point to check ElfSym::GlobalOffsetTable for MIPS case
because InX::MipsGot::empty() always returns false for non-relocatable case, and in case
of relocatable output we do not create special symbols anyways.

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

llvm-svn: 314099
lld/ELF/SyntheticSections.cpp
lld/ELF/Writer.cpp