Index: ELF/InputSection.cpp =================================================================== --- ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -683,10 +683,10 @@ if (Expr == R_NONE) continue; if (Expr != R_ABS) { - error(this->getLocation(Offset) + ": has non-ABS reloc"); + error(this->getLocation(Offset) + ": has non-ABS relocation " + + lld::toString(Type) + " against symbol '" + toString(Sym) + "'"); return; } - uint64_t AddrLoc = getParent()->Addr + Offset; uint64_t SymVA = 0; if (!Sym.isTls() || Out::TlsPhdr) Index: test/ELF/non-abs-reloc.s =================================================================== --- test/ELF/non-abs-reloc.s +++ test/ELF/non-abs-reloc.s @@ -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: