aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2009-07-16 13:18:52 +0000
committerNathan Sidwell <nathan@codesourcery.com>2009-07-16 13:18:52 +0000
commit9a6f4e976ddfb067ae1e954a03d8887d60956cbc (patch)
tree5c056a5483a53a430d3a5e7daefe618ad087d647 /gas
parent3726e6c57f4e006f2744ab5b866ef98f2a79747d (diff)
downloadgdb-9a6f4e976ddfb067ae1e954a03d8887d60956cbc.zip
gdb-9a6f4e976ddfb067ae1e954a03d8887d60956cbc.tar.gz
gdb-9a6f4e976ddfb067ae1e954a03d8887d60956cbc.tar.bz2
gas/
* config/tc-arm.c (md_apply_fix <BFD_RELOC_ARM_TARGET2>): Write the offset for REL targets here. gas/testsuite/ * gas/arm/target-reloc-1.s: New. * gas/arm/target-reloc-1.d: New. ld/testsuite/ * ld-arm/arm-target2.s: Add addend cases. * ld-arm/arm-target2-rel.d: Adjust. * ld-arm/arm-target2-abs.d: Adjust. * ld-arm/arm-target2-got-rel.d: Adjust.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-arm.c9
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/arm/target-reloc-1.d15
-rw-r--r--gas/testsuite/gas/arm/target-reloc-1.s3
5 files changed, 36 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 97c08e5..e7605a7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/tc-arm.c (md_apply_fix <BFD_RELOC_ARM_TARGET2>): Write
+ the offset for REL targets here.
+
2009-07-15 Kai Tietz <kai.tietz@onevision.com>
* listing.c (print_source): Initialize cache by NULL.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 95d6a8d..31eb480 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -20014,10 +20014,17 @@ md_apply_fix (fixS * fixP,
case BFD_RELOC_ARM_GOT32:
case BFD_RELOC_ARM_GOTOFF:
- case BFD_RELOC_ARM_TARGET2:
if (fixP->fx_done || !seg->use_rela_p)
md_number_to_chars (buf, 0, 4);
break;
+
+ case BFD_RELOC_ARM_TARGET2:
+ /* TARGET2 is not partial-inplace, so we need to write the
+ addend here for REL targets, because it won't be written out
+ during reloc processing later. */
+ if (fixP->fx_done || !seg->use_rela_p)
+ md_number_to_chars (buf, fixP->fx_offset, 4);
+ break;
#endif
case BFD_RELOC_RVA:
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index caf8eab..96e1cf0 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gas/arm/target-reloc-1.s: New.
+ * gas/arm/target-reloc-1.d: New.
+
2009-07-14 Daniel Gutson <dgutson@codesourcery.com>
* gas/arm/align64.s: New test case.
diff --git a/gas/testsuite/gas/arm/target-reloc-1.d b/gas/testsuite/gas/arm/target-reloc-1.d
new file mode 100644
index 0000000..7a33b71
--- /dev/null
+++ b/gas/testsuite/gas/arm/target-reloc-1.d
@@ -0,0 +1,15 @@
+#objdump: -dr --show-raw-insn
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix* *-*-vxworks
+#name: TARGET reloc
+
+.*: file format .*arm.*
+
+Disassembly of section .text:
+
+00000000 <foo>:
+ 0: 00001234 .*
+ 0: R_ARM_TARGET2 foo
+ 4: cdef0000 .*
+ 4: R_ARM_TARGET2 foo
+ 8: 76543210 .*
+ 8: R_ARM_TARGET2 foo
diff --git a/gas/testsuite/gas/arm/target-reloc-1.s b/gas/testsuite/gas/arm/target-reloc-1.s
new file mode 100644
index 0000000..b543ab3
--- /dev/null
+++ b/gas/testsuite/gas/arm/target-reloc-1.s
@@ -0,0 +1,3 @@
+foo: .word foo(TARGET2) + 0x1234
+ .word foo + 0xcdef0000(TARGET2)
+ .word (foo + 0x76543210)(TARGET2)