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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 00:55:08 PDT 2017


Author: grimar
Date: Tue Oct 10 00:55:07 2017
New Revision: 315280

URL: http://llvm.org/viewvc/llvm-project?rev=315280&view=rev
Log:
[ELF] - Improve "has non-ABS reloc" error.

It did not contain information about relocation type and symbol.

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

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/test/ELF/non-abs-reloc.s

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=315280&r1=315279&r2=315280&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Tue Oct 10 00:55:07 2017
@@ -685,7 +685,8 @@ void InputSection::relocateNonAlloc(uint
     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;
     }
 

Modified: lld/trunk/test/ELF/non-abs-reloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/non-abs-reloc.s?rev=315280&r1=315279&r2=315280&view=diff
==============================================================================
--- lld/trunk/test/ELF/non-abs-reloc.s (original)
+++ lld/trunk/test/ELF/non-abs-reloc.s Tue Oct 10 00:55:07 2017
@@ -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:




More information about the llvm-commits mailing list