Index: lld/trunk/COFF/InputFiles.cpp =================================================================== --- lld/trunk/COFF/InputFiles.cpp +++ lld/trunk/COFF/InputFiles.cpp @@ -411,7 +411,7 @@ // Returns a string in the format of "foo.obj" or "foo.obj(bar.lib)". std::string lld::toString(coff::InputFile *File) { if (!File) - return "(internal)"; + return ""; if (File->ParentName.empty()) return File->getName().lower(); Index: lld/trunk/COFF/SymbolTable.cpp =================================================================== --- lld/trunk/COFF/SymbolTable.cpp +++ lld/trunk/COFF/SymbolTable.cpp @@ -200,8 +200,7 @@ void SymbolTable::reportDuplicate(Symbol *Existing, InputFile *NewFile) { error("duplicate symbol: " + toString(*Existing) + " in " + - toString(Existing->getFile()) + " and in " + - (NewFile ? toString(NewFile) : "(internal)")); + toString(Existing->getFile()) + " and in " + toString(NewFile)); } Symbol *SymbolTable::addAbsolute(StringRef N, COFFSymbolRef Sym) { Index: lld/trunk/ELF/InputFiles.h =================================================================== --- lld/trunk/ELF/InputFiles.h +++ lld/trunk/ELF/InputFiles.h @@ -42,7 +42,7 @@ class InputFile; } -// Returns "(internal)", "foo.a(bar.o)" or "baz.o". +// Returns "", "foo.a(bar.o)" or "baz.o". std::string toString(const elf::InputFile *F); namespace elf { Index: lld/trunk/ELF/InputSection.cpp =================================================================== --- lld/trunk/ELF/InputSection.cpp +++ lld/trunk/ELF/InputSection.cpp @@ -308,7 +308,7 @@ std::string InputSectionBase::getObjMsg(uint64_t Off) { // Synthetic sections don't have input files. if (!File) - return ("(internal):(" + Name + "+0x" + utohexstr(Off) + ")").str(); + return (":(" + Name + "+0x" + utohexstr(Off) + ")").str(); std::string Filename = File->getName(); std::string Archive; Index: lld/trunk/test/ELF/duplicated-synthetic-sym.s =================================================================== --- lld/trunk/test/ELF/duplicated-synthetic-sym.s +++ lld/trunk/test/ELF/duplicated-synthetic-sym.s @@ -4,7 +4,7 @@ // RUN: not ld.lld %t.o --format binary duplicated-synthetic-sym.s -o %t.elf 2>&1 | FileCheck %s // CHECK: duplicate symbol: _binary_duplicated_synthetic_sym_s_start -// CHECK: defined at (internal):(.data+0x0) +// CHECK: defined at :(.data+0x0) .globl _binary_duplicated_synthetic_sym_s_start _binary_duplicated_synthetic_sym_s_start: Index: lld/trunk/wasm/SymbolTable.cpp =================================================================== --- lld/trunk/wasm/SymbolTable.cpp +++ lld/trunk/wasm/SymbolTable.cpp @@ -73,7 +73,7 @@ void SymbolTable::reportDuplicate(Symbol *Existing, InputFile *NewFile) { error("duplicate symbol: " + toString(*Existing) + "\n>>> defined in " + toString(Existing->getFile()) + "\n>>> defined in " + - (NewFile ? toString(NewFile) : "")); + toString(NewFile)); } static void checkSymbolTypes(Symbol *Existing, InputFile *F, @@ -86,13 +86,10 @@ if (Existing->isFunction() == NewIsFunction) return; - std::string Filename = ""; - if (Existing->getFile()) - Filename = toString(Existing->getFile()); error("symbol type mismatch: " + New->Name + "\n>>> defined as " + - (Existing->isFunction() ? "Function" : "Global") + " in " + Filename + - "\n>>> defined as " + (NewIsFunction ? "Function" : "Global") + " in " + - F->getName()); + (Existing->isFunction() ? "Function" : "Global") + " in " + + toString(Existing->getFile()) + "\n>>> defined as " + + (NewIsFunction ? "Function" : "Global") + " in " + F->getName()); } Symbol *SymbolTable::addDefinedGlobal(StringRef Name) {