aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-06-18 10:18:42 +0100
committerNick Clifton <nickc@redhat.com>2015-06-18 10:18:42 +0100
commit75c11999673ba32027eb17f6df9c37904622ed24 (patch)
tree917740473045b9fe9c96f18b5332ed274a94bea2
parent57b42d6489218e29cb18edd111c97f4390b62ad9 (diff)
downloadbinutils-75c11999673ba32027eb17f6df9c37904622ed24.zip
binutils-75c11999673ba32027eb17f6df9c37904622ed24.tar.gz
binutils-75c11999673ba32027eb17f6df9c37904622ed24.tar.bz2
Fix the computation of the addends for an ARM_TLS_LE32 reloc.
PR gas/18481 bfd * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL. gas * config/tc-arm.c (tc_gen_reloc): Include BFD_RELOC_ARM_TLS_LE32 in the same case as BFD_RELOC_ARM_TLS_IS32. tests * gas/arm/tls.s: Add tests of the tpoff pseudo with a local symbol. * gas/arm/tls.d: Update expected output.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c2
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c4
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/arm/tls.d18
-rw-r--r--gas/testsuite/gas/arm/tls.s23
7 files changed, 62 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index be36403..626d49a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-18 Nick Clifton <nickc@redhat.com>
+
+ PR 18481
+ * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
+
2015-06-15 Jon Turney <jon.turney@dronecode.org.uk>
* bfd.c: Change struct bfd_build_id to use bfd_size_type.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 113f4eb..919df17 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -1606,7 +1606,7 @@ static reloc_howto_type elf32_arm_howto_table_1[] =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ NULL, /* special_function */
"R_ARM_TLS_LE32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3c00a1e..00305e9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2015-06-18 Nick Clifton <nickc@redhat.com>
+
+ PR gas/18481
+ * config/tc-arm.c (tc_gen_reloc): Include BFD_RELOC_ARM_TLS_LE32
+ in the same case as BFD_RELOC_ARM_TLS_IS32.
+
2015-06-17 Nick Clifton <nickc@redhat.com>
* config/tc-arm.c (is_double_a_single): Make conditional upon the
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 0bcbc09..9ccee40 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -23150,7 +23150,7 @@ md_apply_fix (fixS * fixP,
if (rd == REG_SP)
{
- if (value & ~0x1fc)
+ if (value & ~0x1fc)
as_bad_where (fixP->fx_file, fixP->fx_line,
_("invalid immediate for stack address calculation"));
newval = subtract ? T_OPCODE_SUB_ST : T_OPCODE_ADD_ST;
@@ -23564,7 +23564,6 @@ tc_gen_reloc (asection *section, fixS *fixp)
case BFD_RELOC_ARM_SBREL32:
case BFD_RELOC_ARM_PREL31:
case BFD_RELOC_ARM_TARGET2:
- case BFD_RELOC_ARM_TLS_LE32:
case BFD_RELOC_ARM_TLS_LDO32:
case BFD_RELOC_ARM_PCREL_CALL:
case BFD_RELOC_ARM_PCREL_JUMP:
@@ -23602,6 +23601,7 @@ tc_gen_reloc (asection *section, fixS *fixp)
case BFD_RELOC_ARM_TLS_GOTDESC:
case BFD_RELOC_ARM_TLS_GD32:
+ case BFD_RELOC_ARM_TLS_LE32:
case BFD_RELOC_ARM_TLS_IE32:
case BFD_RELOC_ARM_TLS_LDM32:
/* BFD will include the symbol's address in the addend.
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index aa03f44..d929e68 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-18 Nick Clifton <nickc@redhat.com>
+
+ PR gas/18481
+ * gas/arm/tls.s: Add tests of the tpoff pseudo with a local
+ symbol.
+ * gas/arm/tls.d: Update expected output.
+
2015-06-17 Alessandro Marzocchi <alessandro.marzocchi@gmail.com>
PR gas/18500
diff --git a/gas/testsuite/gas/arm/tls.d b/gas/testsuite/gas/arm/tls.d
index 727f8e4..4d7e724 100644
--- a/gas/testsuite/gas/arm/tls.d
+++ b/gas/testsuite/gas/arm/tls.d
@@ -47,3 +47,21 @@ Disassembly of section .text:
3c: R_ARM_TLS_LE32 td
40: 00000017 .word 0x00000017
40: R_ARM_TLS_GOTDESC te
+0+44 <foo>:
+ 44: fffffff4 .word 0xfffffff4
+ 44: R_ARM_TLS_LE32 tbase
+ 48: fffffff8 .word 0xfffffff8
+ 48: R_ARM_TLS_LE32 tbase
+ 4c: fffffffc .word 0xfffffffc
+ 4c: R_ARM_TLS_LE32 tbase
+ 50: 00000000 .word 0x00000000
+ 50: R_ARM_TLS_LE32 tbase
+ 54: 00000004 .word 0x00000004
+ 54: R_ARM_TLS_LE32 tbase
+ 58: 00000008 .word 0x00000008
+ 58: R_ARM_TLS_LE32 tbase
+ 5c: 0000000c .word 0x0000000c
+ 5c: R_ARM_TLS_LE32 tbase
+ 60: 00000000 .word 0x00000000
+ 60: R_ARM_TLS_LE32 tbase
+#pass
diff --git a/gas/testsuite/gas/arm/tls.s b/gas/testsuite/gas/arm/tls.s
index 96a25f5..346ac98 100644
--- a/gas/testsuite/gas/arm/tls.s
+++ b/gas/testsuite/gas/arm/tls.s
@@ -36,3 +36,26 @@ thumb_fn:
.word tc(gottpoff) + (. - 1b - 8)
.word td(tpoff)
1: .word te(tlsdesc) + (. - 2b + 1)
+
+ @ PR 18481
+ .text
+foo:
+ .word tbase(tpoff)-12
+ .word tbase(tpoff)-8
+ .word tbase(tpoff)-4
+ .word tbase(tpoff)+0
+ .word tbase(tpoff)+4
+ .word tbase(tpoff)+8
+ .word tbase(tpoff)+12
+ .word tbase(tpoff)
+
+ .section .tdata,"awT",%progbits
+tbase = . + 12
+ .word -12
+ .word -8
+ .word -4
+ .word 0
+ .word 4
+ .word 8
+ .word 12
+ .word 0