[lld] r272478 - [ELF] - Change wording of error message.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 11 08:59:09 PDT 2016


Author: grimar
Date: Sat Jun 11 10:59:09 2016
New Revision: 272478

URL: http://llvm.org/viewvc/llvm-project?rev=272478&view=rev
Log:
[ELF] - Change wording of error message.

Previously message told us that relocations could
not be used when making shared object. That was
correct because message could appear (and it is expected) 
when we linked executable.
Message should have being changed to something
that says we can't use a subset of relocations against shared
symbols.

Patch fixes the text.

Modified:
    lld/trunk/ELF/Target.cpp
    lld/trunk/test/ELF/aarch64-fpic-abs16.s
    lld/trunk/test/ELF/aarch64-fpic-prel16.s
    lld/trunk/test/ELF/aarch64-fpic-prel32.s
    lld/trunk/test/ELF/aarch64-fpic-prel64.s
    lld/trunk/test/ELF/x86-64-dyn-rel-error.s
    lld/trunk/test/ELF/x86-64-dyn-rel-error2.s
    lld/trunk/test/ELF/x86-64-reloc-32-fpic.s
    lld/trunk/test/ELF/x86-64-reloc-pc32-fpic.s

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Sat Jun 11 10:59:09 2016
@@ -77,7 +77,7 @@ template <unsigned N> static void checkA
 
 static void errorDynRel(uint32_t Type) {
   error("relocation " + getRelName(Type) +
-        " cannot be used when making a shared object; recompile with -fPIC.");
+        " cannot be used against shared object; recompile with -fPIC.");
 }
 
 namespace {

Modified: lld/trunk/test/ELF/aarch64-fpic-abs16.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-fpic-abs16.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-fpic-abs16.s (original)
+++ lld/trunk/test/ELF/aarch64-fpic-abs16.s Sat Jun 11 10:59:09 2016
@@ -1,7 +1,7 @@
 // REQUIRES: aarch64
 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o
 // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
-// CHECK: relocation R_AARCH64_ABS16 cannot be used when making a shared object; recompile with -fPIC.
+// CHECK: relocation R_AARCH64_ABS16 cannot be used against shared object; recompile with -fPIC.
 
 .data
   .hword foo

Modified: lld/trunk/test/ELF/aarch64-fpic-prel16.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-fpic-prel16.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-fpic-prel16.s (original)
+++ lld/trunk/test/ELF/aarch64-fpic-prel16.s Sat Jun 11 10:59:09 2016
@@ -1,7 +1,7 @@
 // REQUIRES: aarch64
 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o
 // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
-// CHECK: relocation R_AARCH64_PREL16 cannot be used when making a shared object; recompile with -fPIC.
+// CHECK: relocation R_AARCH64_PREL16 cannot be used against shared object; recompile with -fPIC.
 
 .data
   .hword foo - .

Modified: lld/trunk/test/ELF/aarch64-fpic-prel32.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-fpic-prel32.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-fpic-prel32.s (original)
+++ lld/trunk/test/ELF/aarch64-fpic-prel32.s Sat Jun 11 10:59:09 2016
@@ -1,7 +1,7 @@
 // REQUIRES: aarch64
 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o
 // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
-// CHECK: relocation R_AARCH64_PREL32 cannot be used when making a shared object; recompile with -fPIC.
+// CHECK: relocation R_AARCH64_PREL32 cannot be used against shared object; recompile with -fPIC.
 
 .data
   .word foo - .

Modified: lld/trunk/test/ELF/aarch64-fpic-prel64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-fpic-prel64.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/aarch64-fpic-prel64.s (original)
+++ lld/trunk/test/ELF/aarch64-fpic-prel64.s Sat Jun 11 10:59:09 2016
@@ -1,7 +1,7 @@
 // REQUIRES: aarch64
 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o
 // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
-// CHECK: relocation R_AARCH64_PREL64 cannot be used when making a shared object; recompile with -fPIC.
+// CHECK: relocation R_AARCH64_PREL64 cannot be used against shared object; recompile with -fPIC.
 
 .data
   .xword foo - .

Modified: lld/trunk/test/ELF/x86-64-dyn-rel-error.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-dyn-rel-error.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-dyn-rel-error.s (original)
+++ lld/trunk/test/ELF/x86-64-dyn-rel-error.s Sat Jun 11 10:59:09 2016
@@ -9,4 +9,4 @@ _start:
         .data
         .long bar
 
-// CHECK: R_X86_64_32 cannot be used when making a shared object; recompile with -fPIC.
+// CHECK: R_X86_64_32 cannot be used against shared object; recompile with -fPIC.

Modified: lld/trunk/test/ELF/x86-64-dyn-rel-error2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-dyn-rel-error2.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-dyn-rel-error2.s (original)
+++ lld/trunk/test/ELF/x86-64-dyn-rel-error2.s Sat Jun 11 10:59:09 2016
@@ -9,4 +9,4 @@ _start:
         .data
         .long bar - .
 
-// CHECK: R_X86_64_PC32 cannot be used when making a shared object; recompile with -fPIC.
+// CHECK: R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC.

Modified: lld/trunk/test/ELF/x86-64-reloc-32-fpic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-reloc-32-fpic.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-reloc-32-fpic.s (original)
+++ lld/trunk/test/ELF/x86-64-reloc-32-fpic.s Sat Jun 11 10:59:09 2016
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
 # RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
-# CHECK: relocation R_X86_64_32 cannot be used when making a shared object; recompile with -fPIC.
+# CHECK: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC.
 
 .data
 .long _shared

Modified: lld/trunk/test/ELF/x86-64-reloc-pc32-fpic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-reloc-pc32-fpic.s?rev=272478&r1=272477&r2=272478&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-reloc-pc32-fpic.s (original)
+++ lld/trunk/test/ELF/x86-64-reloc-pc32-fpic.s Sat Jun 11 10:59:09 2016
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
 # RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s
-# CHECK: relocation R_X86_64_PC32 cannot be used when making a shared object; recompile with -fPIC.
+# CHECK: relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC.
 
 .data
 call _shared




More information about the llvm-commits mailing list