commit eea6dad2b3ae91189caa91145dd133bae0398d21 Author: Kyle McMartin Date: Fri Jun 20 11:14:09 2014 +0100 Similarly to the AArch64 patch, set DF_STATIC_TLS for consistency with other architectures when we emit IE relocs in a shared library. * elf32-arm.c (elf32_arm_check_relocs): Set DF_STATIC_TLS when emitting initial-exec relocs when not linking an executable. --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -12711,6 +12711,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, default: tls_type = GOT_NORMAL; break; } + if (!info->executable && (tls_type & GOT_TLS_IE)) + info->flags |= DF_STATIC_TLS; + if (h != NULL) { h->got.refcount++; --- a/ld/testsuite/ld-arm/tls-gdierelax2.d +++ b/ld/testsuite/ld-arm/tls-gdierelax2.d @@ -11,13 +11,13 @@ Disassembly of section .text: [0-9a-f]+: e59f0004 ldr r0, \[pc, #4\] ; .* [0-9a-f]+: e79f0000 ldr r0, \[pc, r0\] [0-9a-f]+: e1a00000 nop ; .* - [0-9a-f]+: 00008098 .word 0x00008098 - [0-9a-f]+: 0000809c .word 0x0000809c + [0-9a-f]+: 000080a0 .word 0x000080a0 + [0-9a-f]+: 000080a4 .word 0x000080a4 [0-9a-f]+ : [0-9a-f]+: 4801 ldr r0, \[pc, #4\] ; .* [0-9a-f]+: 4478 add r0, pc [0-9a-f]+: 6800 ldr r0, \[r0, #0\] [0-9a-f]+: 46c0 nop ; .* - [0-9a-f]+: 0000808a .word 0x0000808a - [0-9a-f]+: 0000808c .word 0x0000808c + [0-9a-f]+: 00008092 .word 0x00008092 + [0-9a-f]+: 00008094 .word 0x00008094