[PATCH] D42636: [ELF] - Do not forget file name when reporting duplicate symbol error for absolute symbols.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 00:34:16 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD323849: [ELF] - Do not forget file name when reporting duplicate symbol error for… (authored by grimar, committed by ).
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D42636
Files:
ELF/SymbolTable.cpp
test/ELF/abs-conflict.s
Index: test/ELF/abs-conflict.s
===================================================================
--- test/ELF/abs-conflict.s
+++ test/ELF/abs-conflict.s
@@ -15,4 +15,4 @@
// DUP: duplicate symbol: foo
// DUP-NEXT: >>> defined in {{.*}}.o
-// DUP-NEXT: >>> defined in <internal>
+// DUP-NEXT: >>> defined in {{.*}}2.o
Index: ELF/SymbolTable.cpp
===================================================================
--- ELF/SymbolTable.cpp
+++ ELF/SymbolTable.cpp
@@ -423,11 +423,11 @@
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 @@
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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42636.132106.patch
Type: text/x-patch
Size: 1379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180131/6b1b9c65/attachment.bin>
More information about the llvm-commits
mailing list