Change the error message format for duplicate symbols.
authorRui Ueyama <ruiu@google.com>
Fri, 31 Mar 2017 23:40:21 +0000 (23:40 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 31 Mar 2017 23:40:21 +0000 (23:40 +0000)
commit810ce10b8ccc90bcf27083c9f03b49d5b03eaa9f
tree71dbd537b25d00b68e66599ec2b54861e8b344b9
parent3420e4bf94e1a7b52772ab71ee38288ef334ebab
Change the error message format for duplicate symbols.

This patch is intended to improve readability of "duplicate symbol"
error messages.

Without this patch:

  /ssd/clang/bin/ld.lld: error: /ssd/llvm-project/lld/ELF/Relocations.cpp:1054: duplicate symbol 'lld::elf::demangle(llvm::StringRef)'
  /ssd/clang/bin/ld.lld: error: /ssd/llvm-project/lld/ELF/Strings.cpp:93: previous definition was here

With this patch:

  /ssd/clang/bin/ld.lld: error: duplicate symbol: lld::elf::demangle(llvm::StringRef)
  >>> defined at Strings.cpp:93 (/ssd/llvm-project/lld/ELF/Strings.cpp:93)
  >>>            Strings.cpp.o:(lld::elf::demangle(llvm::StringRef)) in archive lib/liblldELF.a
  >>> defined at Relocations.cpp:1054 (/ssd/llvm-project/lld/ELF/Relocations.cpp:1054)
  >>>            Relocations.cpp.o:(.text+0x4C30) in archive lib/liblldELF.a

Discussion thread:
http://lists.llvm.org/pipermail/llvm-dev/2017-March/111459.html

Differential Revision: https://reviews.llvm.org/D31507

llvm-svn: 299280
lld/ELF/SymbolTable.cpp
lld/test/ELF/abs-conflict.s
lld/test/ELF/basic.s
lld/test/ELF/conflict.s
lld/test/ELF/lto/duplicated.ll
lld/test/ELF/tls-mismatch.s