diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-03 22:55:46 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-01-03 22:55:46 +0000 |
commit | 9cded98ad6ac4dc6be7ce9b4b8ae80815c46a41a (patch) | |
tree | c8dc426253679ed5ed5aaa95ae2e684e2c8d1a66 | |
parent | 7c99c1472267e4dfb2edad46555022d98dcd185c (diff) | |
download | bcm5719-llvm-9cded98ad6ac4dc6be7ce9b4b8ae80815c46a41a.tar.gz bcm5719-llvm-9cded98ad6ac4dc6be7ce9b4b8ae80815c46a41a.zip |
Mention symbol name in error message.
llvm-svn: 321769
-rw-r--r-- | lld/ELF/Relocations.cpp | 7 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-abs16.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-prel16.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-prel32.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-prel64.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/x86-64-dyn-rel-error.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/x86-64-dyn-rel-error2.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/x86-64-reloc-32-fpic.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/x86-64-reloc-pc32-fpic.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/x86-64-reloc-tpoff32-fpic.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/znotext-weak-undef.s | 2 |
11 files changed, 13 insertions, 14 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 4fcec81bce6..4eb0adb908b 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -983,10 +983,9 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef<RelTy> Rels) { // We don't know anything about the finaly symbol. Just ask the dynamic // linker to handle the relocation for us. if (!Target->isPicRel(Type)) - errorOrWarn( - "relocation " + toString(Type) + - " cannot be used against shared object; recompile with -fPIC" + - getLocation(Sec, Sym, Offset)); + errorOrWarn("relocation " + toString(Type) + + " cannot be used against symbol " + toString(Sym) + + "; recompile with -fPIC" + getLocation(Sec, Sym, Offset)); InX::RelaDyn->addReloc( {Target->getDynRel(Type), &Sec, Offset, false, &Sym, Addend}); diff --git a/lld/test/ELF/aarch64-fpic-abs16.s b/lld/test/ELF/aarch64-fpic-abs16.s index 2b14b11c75d..f4d8e282768 100644 --- a/lld/test/ELF/aarch64-fpic-abs16.s +++ b/lld/test/ELF/aarch64-fpic-abs16.s @@ -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 against shared object; recompile with -fPIC +// CHECK: relocation R_AARCH64_ABS16 cannot be used against symbol foo; recompile with -fPIC // CHECK-NEXT: >>> defined in {{.*}}.o // CHECK-NEXT: >>> referenced by {{.*}}.o:(.data+0x0) diff --git a/lld/test/ELF/aarch64-fpic-prel16.s b/lld/test/ELF/aarch64-fpic-prel16.s index 1faef9f866e..48adb06e259 100644 --- a/lld/test/ELF/aarch64-fpic-prel16.s +++ b/lld/test/ELF/aarch64-fpic-prel16.s @@ -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: R_AARCH64_PREL16 cannot be used against shared object; recompile with -fPIC +// CHECK: R_AARCH64_PREL16 cannot be used against symbol foo; recompile with -fPIC // CHECK: >>> defined in {{.*}} // CHECK: >>> referenced by {{.*}}:(.data+0x0) diff --git a/lld/test/ELF/aarch64-fpic-prel32.s b/lld/test/ELF/aarch64-fpic-prel32.s index b797dca2f2c..de64bd58099 100644 --- a/lld/test/ELF/aarch64-fpic-prel32.s +++ b/lld/test/ELF/aarch64-fpic-prel32.s @@ -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 against shared object; recompile with -fPIC +// CHECK: relocation R_AARCH64_PREL32 cannot be used against symbol foo; recompile with -fPIC // CHECK: >>> defined in {{.*}} // CHECK: >>> referenced by {{.*}}:(.data+0x0) diff --git a/lld/test/ELF/aarch64-fpic-prel64.s b/lld/test/ELF/aarch64-fpic-prel64.s index 4c67837eac7..ef1fe8d8085 100644 --- a/lld/test/ELF/aarch64-fpic-prel64.s +++ b/lld/test/ELF/aarch64-fpic-prel64.s @@ -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 against shared object; recompile with -fPIC +// CHECK: relocation R_AARCH64_PREL64 cannot be used against symbol foo; recompile with -fPIC // CHECK: >>> defined in {{.*}} // CHECK: >>> referenced by {{.*}}:(.data+0x0) diff --git a/lld/test/ELF/x86-64-dyn-rel-error.s b/lld/test/ELF/x86-64-dyn-rel-error.s index 7a705eb5417..4968771f932 100644 --- a/lld/test/ELF/x86-64-dyn-rel-error.s +++ b/lld/test/ELF/x86-64-dyn-rel-error.s @@ -9,6 +9,6 @@ _start: .data .long zed -// CHECK: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC +// CHECK: relocation R_X86_64_32 cannot be used against symbol zed; recompile with -fPIC // RUN: ld.lld --noinhibit-exec %t.o %t2.so -o %t 2>&1 | FileCheck %s diff --git a/lld/test/ELF/x86-64-dyn-rel-error2.s b/lld/test/ELF/x86-64-dyn-rel-error2.s index 9b731e26887..9980b47d840 100644 --- a/lld/test/ELF/x86-64-dyn-rel-error2.s +++ b/lld/test/ELF/x86-64-dyn-rel-error2.s @@ -4,7 +4,7 @@ // RUN: ld.lld %t2.o -shared -o %t2.so // RUN: not ld.lld -shared %t.o %t2.so -o %t 2>&1 | FileCheck %s -// CHECK: relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC +// CHECK: relocation R_X86_64_PC32 cannot be used against symbol zed; recompile with -fPIC // CHECK: >>> defined in {{.*}}.so // CHECK: >>> referenced by {{.*}}.o:(.data+0x0) diff --git a/lld/test/ELF/x86-64-reloc-32-fpic.s b/lld/test/ELF/x86-64-reloc-32-fpic.s index e3e7c6834d2..b5f11e5fa4c 100644 --- a/lld/test/ELF/x86-64-reloc-32-fpic.s +++ b/lld/test/ELF/x86-64-reloc-32-fpic.s @@ -2,7 +2,7 @@ # 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 against shared object; recompile with -fPIC +# CHECK: relocation R_X86_64_32 cannot be used against symbol _shared; recompile with -fPIC # CHECK: >>> defined in {{.*}} # CHECK: >>> referenced by {{.*}}:(.data+0x0) diff --git a/lld/test/ELF/x86-64-reloc-pc32-fpic.s b/lld/test/ELF/x86-64-reloc-pc32-fpic.s index 399bf604f80..034e6febaf4 100644 --- a/lld/test/ELF/x86-64-reloc-pc32-fpic.s +++ b/lld/test/ELF/x86-64-reloc-pc32-fpic.s @@ -2,7 +2,7 @@ # 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 against shared object; recompile with -fPIC +# CHECK: relocation R_X86_64_PC32 cannot be used against symbol _shared; recompile with -fPIC # CHECK: >>> defined in {{.*}} # CHECK: >>> referenced by {{.*}}:(.data+0x1) diff --git a/lld/test/ELF/x86-64-reloc-tpoff32-fpic.s b/lld/test/ELF/x86-64-reloc-tpoff32-fpic.s index 5be3dc31701..7ae063bcc95 100644 --- a/lld/test/ELF/x86-64-reloc-tpoff32-fpic.s +++ b/lld/test/ELF/x86-64-reloc-tpoff32-fpic.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: not ld.lld %t.o -shared -o %t.so 2>&1 | FileCheck %s -# CHECK: relocation R_X86_64_TPOFF32 cannot be used against shared object; recompile with -fPIC +# CHECK: relocation R_X86_64_TPOFF32 cannot be used against symbol var; recompile with -fPIC # CHECK: >>> defined in {{.*}}.o # CHECK: >>> referenced by {{.*}}.o:(.tdata+0xC) diff --git a/lld/test/ELF/znotext-weak-undef.s b/lld/test/ELF/znotext-weak-undef.s index d606d872bc4..72bb6e2d5e1 100644 --- a/lld/test/ELF/znotext-weak-undef.s +++ b/lld/test/ELF/znotext-weak-undef.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 -z notext -shared %t.o -o %t 2>&1 | FileCheck %s -# CHECK: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC +# CHECK: relocation R_X86_64_32 cannot be used against symbol foo; recompile with -fPIC # RUN: ld.lld -z notext %t.o -o %t # RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=EXE |