shouldKeepInSymtab is called from copyLocalSymbols:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L574
The pre-condition is that symbol should be Defined:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L572
And its section is Live:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L548
InputSection::Discarded section can never be Live. And hence I believe
check I removed in this patch is excessive.
llvm-svn: 335973
if (B.isSection())
return false;
- // If sym references a section in a discarded group, don't keep it.
- if (Sec == &InputSection::Discarded)
- return false;
if (Config->Discard == DiscardPolicy::None)
return true;