summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/SymbolTable.cpp9
-rw-r--r--lld/test/ELF/abs-conflict.s2
2 files changed, 6 insertions, 5 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index baf9e205394..c72186c0b81 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -423,11 +423,11 @@ static void reportDuplicate(Symbol *Sym, InputFile *NewFile) {
toString(Sym->File) + "\n>>> defined in " + toString(NewFile));
}
-static void reportDuplicate(Symbol *Sym, InputSectionBase *ErrSec,
- uint64_t ErrOffset) {
+static void reportDuplicate(Symbol *Sym, InputFile *NewFile,
+ InputSectionBase *ErrSec, uint64_t ErrOffset) {
Defined *D = cast<Defined>(Sym);
if (!D->Section || !ErrSec) {
- reportDuplicate(Sym, ErrSec ? ErrSec->File : nullptr);
+ reportDuplicate(Sym, NewFile);
return;
}
@@ -467,7 +467,8 @@ Symbol *SymbolTable::addRegular(StringRef Name, uint8_t StOther, uint8_t Type,
replaceSymbol<Defined>(S, File, Name, Binding, StOther, Type, Value, Size,
Section);
else if (Cmp == 0)
- reportDuplicate(S, dyn_cast_or_null<InputSectionBase>(Section), Value);
+ reportDuplicate(S, File, dyn_cast_or_null<InputSectionBase>(Section),
+ Value);
return S;
}
diff --git a/lld/test/ELF/abs-conflict.s b/lld/test/ELF/abs-conflict.s
index 4662c48a4e4..ea435cc956c 100644
--- a/lld/test/ELF/abs-conflict.s
+++ b/lld/test/ELF/abs-conflict.s
@@ -15,4 +15,4 @@ foo = 0x123
// DUP: duplicate symbol: foo
// DUP-NEXT: >>> defined in {{.*}}.o
-// DUP-NEXT: >>> defined in <internal>
+// DUP-NEXT: >>> defined in {{.*}}2.o
OpenPOWER on IntegriCloud