COFF: Better error message for duplicate symbols.
Now the symbol table prints out not only symbol names but
also file names for duplicate symbols.
llvm-svn: 240719
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index d11c265..c4b8226 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -184,7 +184,7 @@
if (Sym.isCommon()) {
auto *C = new (Alloc) CommonChunk(Sym);
Chunks.push_back(C);
- return new (Alloc) DefinedCommon(COFFObj.get(), Sym, C);
+ return new (Alloc) DefinedCommon(this, Sym, C);
}
if (Sym.isAbsolute()) {
COFFObj->getSymbolName(Sym, Name);
@@ -215,7 +215,7 @@
}
Chunk *C = SparseChunks[Sym.getSectionNumber()];
if (auto *SC = cast_or_null<SectionChunk>(C)) {
- auto *B = new (Alloc) DefinedRegular(COFFObj.get(), Sym, SC);
+ auto *B = new (Alloc) DefinedRegular(this, Sym, SC);
if (SC->isCOMDAT() && Sym.getValue() == 0 && !AuxP)
SC->setSymbol(B);
return B;