svn commit: r328286 - head/contrib/llvm/tools/lld/ELF

Ed Maste emaste at FreeBSD.org
Tue Jan 23 17:54:40 UTC 2018


Author: emaste
Date: Tue Jan 23 17:54:39 2018
New Revision: 328286
URL: https://svnweb.freebsd.org/changeset/base/328286

Log:
  lld: Don't mark a shared library as needed because of a lazy symbol.
  
  Obtained from:	LLVM r323221 by Rafael Espíndola

Modified:
  head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp

Modified: head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp
==============================================================================
--- head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp	Tue Jan 23 16:52:39 2018	(r328285)
+++ head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp	Tue Jan 23 17:54:39 2018	(r328286)
@@ -491,12 +491,13 @@ void SymbolTable::addShared(StringRef Name, SharedFile
   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;
     }
   }


More information about the svn-src-head mailing list