lld: Don't mark a shared library as needed because of a lazy symbol.

Obtained from:	LLVM r323221 by Rafael Espíndola
This commit is contained in:
Ed Maste 2018-01-23 17:54:39 +00:00
parent 6c41d54855
commit da1eeb70d3

View file

@ -491,12 +491,13 @@ void SymbolTable::addShared(StringRef Name, SharedFile<ELFT> &File,
if (WasInserted || ((S->isUndefined() || S->isLazy()) &&
S->getVisibility() == STV_DEFAULT)) {
uint8_t Binding = S->Binding;
bool WasUndefined = S->isUndefined();
replaceSymbol<SharedSymbol>(S, File, Name, Sym.getBinding(), Sym.st_other,
Sym.getType(), Sym.st_value, Sym.st_size,
Alignment, VerdefIndex);
if (!WasInserted) {
S->Binding = Binding;
if (!S->isWeak() && !Config->GcSections)
if (!S->isWeak() && !Config->GcSections && WasUndefined)
File.IsNeeded = true;
}
}