Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lld/COFF
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-06-28 23:34:09 +0300
committerRui Ueyama <ruiu@google.com>2015-06-28 23:34:09 +0300
commitf24e6f8607350ead67432b52012c03e1fbc62636 (patch)
tree40a66340488b807b0434887d2774f43c52deedcd /lld/COFF
parent016414f55728ef40f2997a53c3ef35cdf7d2f74e (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.cpp11
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.