[llvm-branch-commits] [lld] r323327 - Merging r323221:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 24 06:53:43 PST 2018


Author: hans
Date: Wed Jan 24 06:53:42 2018
New Revision: 323327

URL: http://llvm.org/viewvc/llvm-project?rev=323327&view=rev
Log:
Merging r323221:
------------------------------------------------------------------------
r323221 | rafael | 2018-01-23 17:59:20 +0100 (Tue, 23 Jan 2018) | 3 lines

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

Fixes PR36029.
------------------------------------------------------------------------

Added:
    lld/branches/release_60/test/ELF/Inputs/as-needed-lazy.s
      - copied unchanged from r323221, lld/trunk/test/ELF/Inputs/as-needed-lazy.s
    lld/branches/release_60/test/ELF/as-needed-lazy.s
      - copied unchanged from r323221, lld/trunk/test/ELF/as-needed-lazy.s
Modified:
    lld/branches/release_60/   (props changed)
    lld/branches/release_60/ELF/SymbolTable.cpp

Propchange: lld/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 24 06:53:42 2018
@@ -1 +1 @@
-/lld/trunk:321983,321986,322041,322259,322264
+/lld/trunk:321983,321986,322041,322259,322264,323221

Modified: lld/branches/release_60/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_60/ELF/SymbolTable.cpp?rev=323327&r1=323326&r2=323327&view=diff
==============================================================================
--- lld/branches/release_60/ELF/SymbolTable.cpp (original)
+++ lld/branches/release_60/ELF/SymbolTable.cpp Wed Jan 24 06:53:42 2018
@@ -491,12 +491,13 @@ void SymbolTable::addShared(StringRef Na
   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 llvm-branch-commits mailing list