[ELF] - Improve "has non-ABS reloc" error.

It did not contain information about relocation type and symbol.

Differential revision: https://reviews.llvm.org/D38623

llvm-svn: 315280
This commit is contained in:
George Rimar 2017-10-10 07:55:07 +00:00
parent d36bbe9c89
commit 7e9c5610c9
2 changed files with 3 additions and 2 deletions

View File

@ -685,7 +685,8 @@ void InputSection::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
if (Expr == R_NONE)
continue;
if (Expr != R_ABS) {
error(this->getLocation<ELFT>(Offset) + ": has non-ABS reloc");
error(this->getLocation<ELFT>(Offset) + ": has non-ABS relocation " +
toString(Type) + " against symbol '" + toString(Sym) + "'");
return;
}

View File

@ -1,7 +1,7 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: not ld.lld %t.o -o %t.so -shared 2>&1 | FileCheck %s
// CHECK: {{.*}}:(.dummy+0x0): has non-ABS reloc
// CHECK: {{.*}}:(.dummy+0x0): has non-ABS relocation R_X86_64_GOTPCREL against symbol 'foo'
.globl _start
_start: