forked from OSchip/llvm-project
[ELF] Remove -Wl,-z,notext hint
The hint does not pull its weight: * adding -Wl,-z,notext often won't work (relocation types other than `symbolRel`, e.g. `R_AARCH64_LDST32_ABS_LO12_NC`) * for pure (no assembly) C/C++ projects, the "-fPIC" hint is sufficient
This commit is contained in:
parent
81a6eabf71
commit
55e69ece72
|
@ -1095,19 +1095,10 @@ static void processRelocAux(InputSectionBase &sec, RelExpr expr, RelType type,
|
|||
}
|
||||
|
||||
if (config->isPic) {
|
||||
if (!canWrite && !isRelExpr(expr))
|
||||
errorOrWarn(
|
||||
"can't create dynamic relocation " + toString(type) + " against " +
|
||||
(sym.getName().empty() ? "local symbol"
|
||||
: "symbol: " + toString(sym)) +
|
||||
" in readonly segment; recompile object files with -fPIC "
|
||||
"or pass '-Wl,-z,notext' to allow text relocations in the output" +
|
||||
getLocation(sec, sym, offset));
|
||||
else
|
||||
errorOrWarn(
|
||||
"relocation " + toString(type) + " cannot be used against " +
|
||||
(sym.getName().empty() ? "local symbol" : "symbol " + toString(sym)) +
|
||||
"; recompile with -fPIC" + getLocation(sec, sym, offset));
|
||||
errorOrWarn("relocation " + toString(type) + " cannot be used against " +
|
||||
(sym.getName().empty() ? "local symbol"
|
||||
: "symbol '" + toString(sym) + "'") +
|
||||
"; recompile with -fPIC" + getLocation(sec, sym, offset));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
## Test we don't create R_AARCH64_RELATIVE.
|
||||
|
||||
# CHECK: error: relocation R_AARCH64_ABS32 cannot be used against symbol hidden; recompile with -fPIC
|
||||
# CHECK: error: relocation R_AARCH64_ABS32 cannot be used against symbol 'hidden'; recompile with -fPIC
|
||||
|
||||
.globl hidden
|
||||
.hidden hidden
|
||||
|
|
|
@ -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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: relocation R_AARCH64_ABS16 cannot be used against symbol foo; 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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: dat in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol dat; recompile with -fPIC
|
||||
// CHECK: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+0x0)
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// REQUIRES: aarch64
|
||||
// RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o
|
||||
// RUN: not ld.lld -shared %t.o -o /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol dat; recompile with -fPIC
|
||||
// CHECK: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+0x0)
|
||||
// CHECK: relocation R_AARCH64_ADR_PREL_PG_HI21_NC cannot be used against symbol dat; recompile with -fPIC
|
||||
// CHECK: error: relocation R_AARCH64_ADR_PREL_PG_HI21_NC cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
|
||||
adrp x0, dat
|
||||
adrp x0, :pg_hi21_nc:dat
|
||||
|
|
|
@ -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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: can't create dynamic relocation R_AARCH64_LDST32_ABS_LO12_NC against symbol: dat in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_AARCH64_LDST32_ABS_LO12_NC cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol: dat in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: can't create dynamic relocation R_AARCH64_LDST8_ABS_LO12_NC against symbol: dat in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_AARCH64_LDST8_ABS_LO12_NC cannot be used against symbol 'dat'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: R_AARCH64_PREL16 cannot be used against symbol foo; 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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: relocation R_AARCH64_PREL32 cannot be used against symbol foo; recompile with -fPIC
|
||||
// CHECK: error: 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 /dev/null 2>&1 | FileCheck %s
|
||||
// CHECK: relocation R_AARCH64_PREL64 cannot be used against symbol foo; recompile with -fPIC
|
||||
// CHECK: error: relocation R_AARCH64_PREL64 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}
|
||||
// CHECK: >>> referenced by {{.*}}:(.data+0x0)
|
||||
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
// RELATIVE: <$d.0>:
|
||||
// RELATIVE: 10150: 04 00 00 00 .word 0x00000004
|
||||
|
||||
// ABS: can't create dynamic relocation R_ARM_TARGET1 against symbol: patatino in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// ABS: relocation R_ARM_TARGET1 cannot be used against symbol 'patatino'; recompile with -fPIC
|
||||
// ABS: >>> defined in {{.*}}.o
|
||||
// ABS: >>> referenced by {{.*}}.o:(.text+0x0)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t2.o
|
||||
// RUN: not ld.lld %t2.o %t1.so -o /dev/null -shared 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_X86_64_64 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.so
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.text+0x0)
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
// REQUIRES: x86
|
||||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
// RUN: not ld.lld %t.o -o /dev/null -shared 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK-NEXT: >>> defined in {{.*}}.o
|
||||
// CHECK-NEXT: >>> referenced by {{.*}}.o:(.text+0x0)
|
||||
|
||||
foo:
|
||||
.quad foo
|
|
@ -2,7 +2,7 @@
|
|||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
// RUN: not ld.lld %t.o %t.o -o /dev/null -shared 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_X86_64_64 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
// CHECK: >>> defined in {{.*}}.o
|
||||
// CHECK: >>> referenced by {{.*}}.o:(.eh_frame+0x12)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
## Here we check that symbol 'foo' location is reported properly.
|
||||
|
||||
# CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol foo
|
||||
# CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol 'foo'
|
||||
# CHECK: >>> defined in {{.*}}.script:1
|
||||
# CHECK: >>> referenced by {{.*}}.o:(.text+0x1)
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# RUN: not ld.lld -shared %t-nopic.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=NOPIC-ERR
|
||||
## Note: ld.bfd can link this file because it rewrites the .eh_frame section to use
|
||||
## relative addressing.
|
||||
# NOPIC-ERR: ld.lld: error: can't create dynamic relocation R_MIPS_64 against local symbol in readonly segment
|
||||
# NOPIC-ERR: ld.lld: error: relocation R_MIPS_64 cannot be used against local symbol
|
||||
|
||||
## For -fPIC, .eh_frame should contain DW_EH_PE_pcrel | DW_EH_PE_sdata4 values:
|
||||
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux --position-independent %s -o %t-pic.o
|
||||
|
@ -25,7 +25,7 @@
|
|||
# RUN: not ld.lld -shared %t-nopic32.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=NOPIC32-ERR
|
||||
## Note: ld.bfd can link this file because it rewrites the .eh_frame section to use
|
||||
## relative addressing.
|
||||
# NOPIC32-ERR: ld.lld: error: can't create dynamic relocation R_MIPS_32 against local symbol in readonly segment
|
||||
# NOPIC32-ERR: ld.lld: error: relocation R_MIPS_32 cannot be used against local symbol
|
||||
|
||||
## For -fPIC, .eh_frame should contain DW_EH_PE_pcrel | DW_EH_PE_sdata4 values:
|
||||
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux --position-independent %s -o %t-pic32.o
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
## Test we don't create R_AARCH64_RELATIVE.
|
||||
|
||||
# CHECK: error: relocation R_PPC64_ADDR32 cannot be used against symbol hidden; recompile with -fPIC
|
||||
# CHECK: error: relocation R_PPC64_ADDR32 cannot be used against symbol 'hidden'; recompile with -fPIC
|
||||
|
||||
.globl hidden
|
||||
.hidden hidden
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
// RUN: not ld.lld %t.o -o /dev/null -shared 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: error: can't create dynamic relocation R_X86_64_SIZE64 against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: error: relocation R_X86_64_SIZE64 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
|
||||
.global foo
|
||||
foo:
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# DIS: 1000: auipc gp, 3
|
||||
# DIS-NEXT: addi gp, gp, -2048
|
||||
|
||||
# ERR: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol __global_pointer$; recompile with -fPIC
|
||||
# ERR: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol '__global_pointer$'; recompile with -fPIC
|
||||
|
||||
lla gp, __global_pointer$
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t.o
|
||||
# RUN: not ld.lld -shared %t.o -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: error: relocation R_RISCV_32 cannot be used against symbol a
|
||||
# CHECK: error: relocation R_RISCV_32 cannot be used against symbol 'a'
|
||||
|
||||
.globl a
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
// RUN: not ld.lld -shared --vs-diagnostics %t.o -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: dyn.s(15): error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
|
||||
// CHECK: dyn.s(15): error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
|
||||
// CHECK-NEXT: >>> defined in {{.*}}.o
|
||||
// CHECK-NEXT: >>> referenced by dyn.s:15
|
||||
// CHECK-NEXT: >>>{{.*}}.o:(.text+0x{{.+}})
|
||||
|
||||
// CHECK: /tmp{{/|\\}}dyn.s(20): error: can't create dynamic relocation {{.*}}
|
||||
// CHECK: /tmp{{/|\\}}dyn.s(20): error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
|
||||
// CHECK-NEXT: >>> defined in {{.*}}.o
|
||||
// CHECK-NEXT: >>> referenced by dyn.s:20 (/tmp{{/|\\}}dyn.s:20)
|
||||
// CHECK-NEXT: >>>{{.*}}.o:(.text+0x{{.+}})
|
||||
|
|
|
@ -9,7 +9,7 @@ _start:
|
|||
.data
|
||||
.long zed
|
||||
|
||||
// CHECK: relocation R_X86_64_32 cannot be used against symbol zed; recompile with -fPIC
|
||||
// CHECK: error: relocation R_X86_64_32 cannot be used against symbol 'zed'; recompile with -fPIC
|
||||
|
||||
// RUN: ld.lld --noinhibit-exec %t.o %t2.so -o /dev/null 2>&1 | FileCheck --check-prefix=WARN %s
|
||||
// RUN: not ld.lld --export-dynamic --unresolved-symbols=ignore-all %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=WARN %s
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// RUN: ld.lld %t2.o -shared -o %t2.so
|
||||
// RUN: not ld.lld -shared %t.o %t2.so -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: relocation R_X86_64_PC32 cannot be used against symbol zed; recompile with -fPIC
|
||||
// CHECK: error: 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,10 +2,10 @@
|
|||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
# RUN: not ld.lld %t.o -shared -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: relocation R_X86_64_8 cannot be used against symbol foo; recompile with -fPIC
|
||||
# CHECK: relocation R_X86_64_16 cannot be used against symbol foo; recompile with -fPIC
|
||||
# CHECK: relocation R_X86_64_PC8 cannot be used against symbol foo; recompile with -fPIC
|
||||
# CHECK: relocation R_X86_64_PC16 cannot be used against symbol foo; recompile with -fPIC
|
||||
# CHECK: error: relocation R_X86_64_8 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
# CHECK: error: relocation R_X86_64_16 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
# CHECK: error: relocation R_X86_64_PC8 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
# CHECK: error: relocation R_X86_64_PC16 cannot be used against symbol 'foo'; recompile with -fPIC
|
||||
|
||||
.global foo
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ hidden:
|
|||
# CHECK: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
|
||||
|
||||
# PIE: error: cannot preempt symbol: hidden
|
||||
# SHARED: error: relocation R_X86_64_32 cannot be used against symbol hidden; recompile with -fPIC
|
||||
# SHARED: error: relocation R_X86_64_32 cannot be used against symbol 'hidden'; recompile with -fPIC
|
||||
|
||||
.data
|
||||
.byte local # R_X86_64_8
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/shared.s -o %t/shared.o
|
||||
# RUN: not ld.lld -shared %t/shared.o -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: relocation R_X86_64_32 cannot be used against symbol _shared; recompile with -fPIC
|
||||
# CHECK: error: relocation R_X86_64_32 cannot be used against symbol '_shared'; recompile with -fPIC
|
||||
# CHECK: >>> defined in {{.*}}
|
||||
# CHECK: >>> referenced by {{.*}}:(.data+0x0)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/shared.s -o %t/shared.o
|
||||
# RUN: not ld.lld -shared %t/shared.o -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: relocation R_X86_64_PC32 cannot be used against symbol _shared; recompile with -fPIC
|
||||
# CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol '_shared'; recompile with -fPIC
|
||||
# CHECK: >>> defined in {{.*}}
|
||||
# CHECK: >>> referenced by {{.*}}:(.data+0x1)
|
||||
|
||||
|
|
|
@ -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 /dev/null 2>&1 | FileCheck %s
|
||||
# CHECK: relocation R_X86_64_32 cannot be used against symbol foo; recompile with -fPIC
|
||||
# CHECK: error: 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
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
# RUN: not ld.lld %t.o %t2.so -o /dev/null -shared 2>&1 | FileCheck --check-prefix=ERR %s
|
||||
# RUN: not ld.lld -z text %t.o %t2.so -o /dev/null -shared 2>&1 | FileCheck --check-prefix=ERR %s
|
||||
# ERR: error: can't create dynamic relocation
|
||||
# ERR: error: relocation R_X86_64_64 cannot be used against symbol 'bar'; recompile with -fPIC
|
||||
|
||||
# If the preference is to have text relocations, don't create plt of copy relocations.
|
||||
|
||||
|
|
Loading…
Reference in New Issue