diff options
author | Rui Ueyama <ruiu@google.com> | 2015-06-28 23:34:09 +0300 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-06-28 23:34:09 +0300 |
commit | f24e6f8607350ead67432b52012c03e1fbc62636 (patch) | |
tree | 40a66340488b807b0434887d2774f43c52deedcd /lld/COFF | |
parent | 016414f55728ef40f2997a53c3ef35cdf7d2f74e (diff) |
COFF: Undefined weak aliases are not fatal if /force is given.
llvm-svn: 240917
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. |