diff options
Diffstat (limited to 'lld/COFF')
-rw-r--r-- | lld/COFF/SymbolTable.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lld/COFF/SymbolTable.cpp b/lld/COFF/SymbolTable.cpp index aae6b22b4a09..b823ce9eacb5 100644 --- a/lld/COFF/SymbolTable.cpp +++ b/lld/COFF/SymbolTable.cpp @@ -71,15 +71,12 @@ bool SymbolTable::reportRemainingUndefines() { 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. |