mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 17:43:57 +00:00
Mention symbol name in error message.
llvm-svn: 321769
This commit is contained in:
parent
7c99c14722
commit
9cded98ad6
@ -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});
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user