diff options
-rw-r--r-- | lld/ELF/Relocations.cpp | 3 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/arm-target1.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/copy-in-shared.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/copy-rel-pie-error.s | 4 | ||||
-rw-r--r-- | lld/test/ELF/dynamic-reloc-in-ro.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/eh-frame-dyn-rel.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/got32-i386.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/got32x-i386.s | 4 | ||||
-rw-r--r-- | lld/test/ELF/relocation-size-err.s | 2 |
13 files changed, 16 insertions, 15 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 0f975be42c0..8403ba47779 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -814,7 +814,8 @@ static RelExpr processRelocAux(InputSectionBase &Sec, RelExpr Expr, error( "can't create dynamic relocation " + toString(Type) + " against " + (Sym.getName().empty() ? "local symbol" : "symbol: " + toString(Sym)) + - " in readonly segment; recompile object files with -fPIC" + + " in readonly segment; recompile object files with -fPIC " + "or pass '-Wl,-z,notext' to allow text relocations in the output" + getLocation(Sec, Sym, Offset)); return Expr; } diff --git a/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s index 9e13fd18af4..9f5608172e0 100644 --- a/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-add_abs_lo12_nc.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: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: dat +// 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: >>> defined in {{.*}}.o // CHECK: >>> referenced by {{.*}}.o:(.text+0x0) diff --git a/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s index 02b75a5bfcd..b263fe79219 100644 --- a/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.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: can't create dynamic relocation R_AARCH64_LDST32_ABS_LO12_NC against symbol: dat +// 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: >>> defined in {{.*}}.o // CHECK: >>> referenced by {{.*}}.o:(.text+0x0) diff --git a/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s index 45e4f2032c1..3739ab3ed27 100644 --- a/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.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: can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol: dat +// 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: >>> defined in {{.*}}.o // CHECK: >>> referenced by {{.*}}.o:(.text+0x0) diff --git a/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s b/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s index 16e7df1bc4a..4354ffdc877 100644 --- a/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s +++ b/lld/test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.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: can't create dynamic relocation R_AARCH64_LDST8_ABS_LO12_NC against symbol: dat +// 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: >>> defined in {{.*}}.o // CHECK: >>> referenced by {{.*}}.o:(.text+0x0) diff --git a/lld/test/ELF/arm-target1.s b/lld/test/ELF/arm-target1.s index e77fa57bbf1..2fc0b8bc428 100644 --- a/lld/test/ELF/arm-target1.s +++ b/lld/test/ELF/arm-target1.s @@ -31,6 +31,6 @@ // RELATIVE: SYMBOL TABLE: // RELATIVE: 00001004 .text 00000000 patatino -// ABS: can't create dynamic relocation R_ARM_TARGET1 against symbol: patatino +// 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: >>> defined in {{.*}}.o // ABS: >>> referenced by {{.*}}.o:(.text+0x0) diff --git a/lld/test/ELF/copy-in-shared.s b/lld/test/ELF/copy-in-shared.s index 70439853c7c..6af54c14dee 100644 --- a/lld/test/ELF/copy-in-shared.s +++ b/lld/test/ELF/copy-in-shared.s @@ -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 %t2.so -shared 2>&1 | FileCheck %s -// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: foo in readonly segment +// 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: >>> defined in {{.*}}.so // CHECK: >>> referenced by {{.*}}.o:(.text+0x0) diff --git a/lld/test/ELF/copy-rel-pie-error.s b/lld/test/ELF/copy-rel-pie-error.s index 6f7677e25e3..e2fd5b5347f 100644 --- a/lld/test/ELF/copy-rel-pie-error.s +++ b/lld/test/ELF/copy-rel-pie-error.s @@ -3,11 +3,11 @@ // RUN: ld.lld %t2.o -o %t2.so -shared // RUN: not ld.lld %t.o %t2.so -o %t.exe -pie 2>&1 | FileCheck %s -// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: bar +// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: bar in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output // CHECK: >>> defined in {{.*}}.so // CHECK: >>> referenced by {{.*}}.o:(.text+0x0) -// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: foo +// 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: >>> defined in {{.*}}.so // CHECK: >>> referenced by {{.*}}.o:(.text+0x8) diff --git a/lld/test/ELF/dynamic-reloc-in-ro.s b/lld/test/ELF/dynamic-reloc-in-ro.s index ecdbfeb6658..4dee4f66190 100644 --- a/lld/test/ELF/dynamic-reloc-in-ro.s +++ b/lld/test/ELF/dynamic-reloc-in-ro.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 -o %t.so -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 +// 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) diff --git a/lld/test/ELF/eh-frame-dyn-rel.s b/lld/test/ELF/eh-frame-dyn-rel.s index 289e6c0150d..a244ac62018 100644 --- a/lld/test/ELF/eh-frame-dyn-rel.s +++ b/lld/test/ELF/eh-frame-dyn-rel.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 %t.o -o %t -shared 2>&1 | FileCheck %s -// CHECK: can't create dynamic relocation R_X86_64_64 against symbol: foo +// 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: >>> defined in {{.*}}.o // CHECK: >>> referenced by {{.*}}.o:(.eh_frame+0x12) diff --git a/lld/test/ELF/got32-i386.s b/lld/test/ELF/got32-i386.s index 00c7c0d6d55..dce50d0afc2 100644 --- a/lld/test/ELF/got32-i386.s +++ b/lld/test/ELF/got32-i386.s @@ -20,4 +20,4 @@ _start: # CHECK: .got 00000004 0000000000012000 # RUN: not ld.lld %t.o -o %t -pie 2>&1 | FileCheck %s --check-prefix=ERR -# ERR: error: can't create dynamic relocation R_386_GOT32 against symbol: foo in readonly segment; recompile object files with -fPIC +# ERR: error: can't create dynamic relocation R_386_GOT32 against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output diff --git a/lld/test/ELF/got32x-i386.s b/lld/test/ELF/got32x-i386.s index 17c9a1cce3f..610051e8a96 100644 --- a/lld/test/ELF/got32x-i386.s +++ b/lld/test/ELF/got32x-i386.s @@ -43,5 +43,5 @@ # RUN: not ld.lld %S/Inputs/i386-got32x-baseless.elf -o %t1 -pie 2>&1 | \ # RUN: FileCheck %s --check-prefix=ERR -# ERR: error: can't create dynamic relocation R_386_GOT32X against symbol: foo in readonly segment; recompile object files with -fPIC -# ERR: error: can't create dynamic relocation R_386_GOT32X against symbol: foo in readonly segment; recompile object files with -fPIC +# ERR: error: can't create dynamic relocation R_386_GOT32X against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output +# ERR: error: can't create dynamic relocation R_386_GOT32X against symbol: foo in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output diff --git a/lld/test/ELF/relocation-size-err.s b/lld/test/ELF/relocation-size-err.s index 7bef45b6604..763ad875ebd 100644 --- a/lld/test/ELF/relocation-size-err.s +++ b/lld/test/ELF/relocation-size-err.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 -o %t.so -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 +// 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 .global foo foo: |