forked from OSchip/llvm-project
[ELF] Prevent SEGFAULT in case of conflict with an internally defined symbol.
Differential Revision: http://reviews.llvm.org/D14832 llvm-svn: 253588
This commit is contained in:
parent
c12c2790e1
commit
4bc5ad4c37
|
@ -139,7 +139,8 @@ void SymbolTable<ELFT>::reportConflict(const Twine &Message,
|
|||
}
|
||||
|
||||
std::string Msg = (Message + ": " + Old.getName() + " in " +
|
||||
OldFile->getName() + " and " + NewFile->getName())
|
||||
(OldFile ? OldFile->getName() : "(internal)") + " and " +
|
||||
(NewFile ? NewFile->getName() : "(internal)"))
|
||||
.str();
|
||||
if (Warning)
|
||||
warning(Msg);
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# Should print an expected message in case of conflict with an internally generated symbol.
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
|
||||
# RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: duplicate symbol: _gp in (internal) and {{.*}}
|
||||
|
||||
# REQUIRES: mips
|
||||
|
||||
.globl _gp
|
||||
_gp = 0
|
Loading…
Reference in New Issue