{
object = _("a shared object");
if (!pic)
- pic = _("; recompile with -fPIC");
+ pic = (howto->type == R_X86_64_TPOFF32
+ ? _("; replace local-exec with initial-exec TLS model")
+ : _("; recompile with -fPIC"));
}
else
{
goto create_got;
case R_X86_64_TPOFF32:
- if (!bfd_link_executable (info) && ABI_64_P (abfd))
+ if (!bfd_link_executable (info))
{
elf_x86_64_need_pic (info, abfd, sec, h, symtab_hdr, isym,
&x86_64_elf_howto_table[r_type]);
--- /dev/null
+#source: tls-le-pic-1.s
+#as: --x32
+#ld: -shared -melf32_x86_64
+#error: .*: relocation R_X86_64_TPOFF32 against symbol `foo' can not be used when making a shared object; replace local-exec with initial-exec TLS model
--- /dev/null
+#as: --64
+#ld: -shared -melf_x86_64
+#error: .*: relocation R_X86_64_TPOFF32 against symbol `foo' can not be used when making a shared object; replace local-exec with initial-exec TLS model
--- /dev/null
+ .text
+ .p2align 4
+ .globl func
+ .type func, @function
+func:
+ movq %fs:0, %rax
+ addq $foo@tpoff, %rax
+ ret
+ .size func, .-func
+ .section .tbss,"awT",@nobits
+ .align 4
+ .globl foo
+ .type foo, @object
+ .size foo, 4
+foo:
+ .zero 4
+ .section .note.GNU-stack,"",@progbits
--- /dev/null
+#source: tls-le-pic-2.s
+#as: --x32
+#ld: -shared -melf32_x86_64
+#error: .*: relocation R_X86_64_TPOFF32 against undefined symbol `foo' can not be used when making a shared object; replace local-exec with initial-exec TLS model
--- /dev/null
+#as: --64
+#ld: -shared -melf_x86_64
+#error: .*: relocation R_X86_64_TPOFF32 against undefined symbol `foo' can not be used when making a shared object; replace local-exec with initial-exec TLS model
--- /dev/null
+ .text
+ .p2align 4
+ .globl func
+ .type func, @function
+func:
+ movq %fs:0, %rax
+ addq $foo@tpoff, %rax
+ ret
+ .size func, .-func
+ .section .note.GNU-stack,"",@progbits
--- /dev/null
+#source: tls-le-pic-3.s
+#as: --x32
+#ld: -shared -melf32_x86_64
+#error: .*: relocation R_X86_64_TPOFF32 against `foo' can not be used when making a shared object; replace local-exec with initial-exec TLS model
--- /dev/null
+#as: --64
+#ld: -shared -melf_x86_64
+#error: .*: relocation R_X86_64_TPOFF32 against `foo' can not be used when making a shared object; replace local-exec with initial-exec TLS model
--- /dev/null
+ .text
+ .p2align 4
+ .globl func
+ .type func, @function
+func:
+ movq %fs:0, %rax
+ addq $foo@tpoff, %rax
+ ret
+ .size func, .-func
+ .section .tbss,"awT",@nobits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .zero 4
+ .section .note.GNU-stack,"",@progbits
run_dump_test "pr33292-x32"
run_dump_test "pr28387"
run_dump_test "pr28387-x32"
+run_dump_test "tls-le-pic-1"
+run_dump_test "tls-le-pic-1-x32"
+run_dump_test "tls-le-pic-2"
+run_dump_test "tls-le-pic-2-x32"
+run_dump_test "tls-le-pic-3"
+run_dump_test "tls-le-pic-3-x32"
if { ![skip_sframe_tests] } {
run_dump_test "sframe-simple-1"