aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorYury Norov <ynorov@caviumnetworks.com>2016-12-14 11:56:54 +0530
committerYury Norov <ynorov@caviumnetworks.com>2016-12-14 11:56:54 +0530
commit98fa61facff8fb041205950d642f5403372bfd96 (patch)
tree17e402b0dd7c42d671b2a4142fbc33f7342b1064 /bfd
parenta02c3512655cc2c8ad68e4b656959b7d284acc7d (diff)
downloadfsf-binutils-gdb-98fa61facff8fb041205950d642f5403372bfd96.zip
fsf-binutils-gdb-98fa61facff8fb041205950d642f5403372bfd96.tar.gz
fsf-binutils-gdb-98fa61facff8fb041205950d642f5403372bfd96.tar.bz2
Revert "ld: aarch64: fix TLS relaxation where TCB_SIZE is used"
This reverts commit 6650f7bd18f8161b9f666d3e65a6346e23a9d85f.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elfnn-aarch64.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index b05e7cf..ffa8e6a 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5951,9 +5951,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
/* LD->LE relaxation (tiny):
adr x0, :tlsldm:x => mrs x0, tpidr_el0
- bl __tls_get_addr => add R0, R0, TCB_SIZE
-
- Where R is x for lp64 mode, and w for ilp32 mode.
+ bl __tls_get_addr => add x0, x0, TCB_SIZE
*/
if (is_local)
{
@@ -5962,11 +5960,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
/* No need of CALL26 relocation for tls_get_addr. */
rel[1].r_info = ELFNN_R_INFO (STN_UNDEF, R_AARCH64_NONE);
bfd_putl32 (0xd53bd040, contents + rel->r_offset + 0);
-#if ARCH_SIZE ==64
bfd_putl32 (0x91004000, contents + rel->r_offset + 4);
-#else
- bfd_putl32 (0x11002000, contents + rel->r_offset + 4);
-#endif
return bfd_reloc_ok;
}
return bfd_reloc_continue;
@@ -5984,10 +5978,8 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
/* LD->LE relaxation (small):
- add x0, #:tlsldm_lo12:x => add R0, R0, TCB_SIZE
+ add x0, #:tlsldm_lo12:x => add x0, x0, TCB_SIZE
bl __tls_get_addr => nop
-
- Where R is x for lp64 mode, and w for ilp32 mode.
*/
if (is_local)
{
@@ -5995,12 +5987,8 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals,
BFD_ASSERT (ELFNN_R_TYPE (rel[1].r_info) == AARCH64_R (CALL26));
/* No need of CALL26 relocation for tls_get_addr. */
rel[1].r_info = ELFNN_R_INFO (STN_UNDEF, R_AARCH64_NONE);
-#if ARCH_SIZE ==64
bfd_putl32 (0x91004000, contents + rel->r_offset + 0);
-#else
- bfd_putl32 (0x11002000, contents + rel->r_offset + 0);
-#endif
- bfd_putl32 (INSN_NOP, contents + rel->r_offset + 4);
+ bfd_putl32 (0xd503201f, contents + rel->r_offset + 4);
return bfd_reloc_ok;
}
return bfd_reloc_continue;