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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 06:32:04 PDT 2017


grimar created this revision.
Herald added a subscriber: emaste.

It did not contain information about relocation type and symbol.
Relative to PR34852.


https://reviews.llvm.org/D38623

Files:
  ELF/InputSection.cpp
  test/ELF/non-abs-reloc.s


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:
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<ELFT>(Offset) + ": has non-ABS reloc");
+      error(this->getLocation<ELFT>(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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38623.117987.patch
Type: text/x-patch
Size: 1093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171006/58855a2c/attachment.bin>


More information about the llvm-commits mailing list