[lld] r240917 - COFF: Undefined weak aliases are not fatal if /force is given.

Rui Ueyama ruiu at google.com
Sun Jun 28 13:34:09 PDT 2015


Author: ruiu
Date: Sun Jun 28 15:34:09 2015
New Revision: 240917

URL: http://llvm.org/viewvc/llvm-project?rev=240917&view=rev
Log:
COFF: Undefined weak aliases are not fatal if /force is given.

Modified:
    lld/trunk/COFF/SymbolTable.cpp

Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=240917&r1=240916&r2=240917&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Sun Jun 28 15:34:09 2015
@@ -71,15 +71,12 @@ bool SymbolTable::reportRemainingUndefin
     if (!Undef)
       continue;
     StringRef Name = Undef->getName();
+    // The weak alias may have been resovled, so check for that.
     if (SymbolBody *Alias = Undef->getWeakAlias()) {
-      Sym->Body = Alias->getReplacement();
-      if (!isa<Defined>(Sym->Body)) {
-        // Aliases are yet another symbols pointed by other symbols
-        // that could also remain undefined.
-        llvm::errs() << "undefined symbol: " << Name << "\n";
-        Ret = true;
+      if (auto *D = dyn_cast<Defined>(Alias->getReplacement())) {
+        Sym->Body = D;
+        continue;
       }
-      continue;
     }
     // If we can resolve a symbol by removing __imp_ prefix, do that.
     // This odd rule is for compatibility with MSVC linker.





More information about the llvm-commits mailing list