gas/
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 16 Jul 2009 13:18:52 +0000 (13:18 +0000)
committerNathan Sidwell <nathan@codesourcery.com>
Thu, 16 Jul 2009 13:18:52 +0000 (13:18 +0000)
* 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.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/target-reloc-1.d [new file with mode: 0644]
gas/testsuite/gas/arm/target-reloc-1.s [new file with mode: 0644]
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-target2-abs.d
ld/testsuite/ld-arm/arm-target2-got-rel.d
ld/testsuite/ld-arm/arm-target2-rel.d
ld/testsuite/ld-arm/arm-target2.s

index 97c08e584f8c98100e752594b2a8fdc24da2828f..e7605a7a2de308390cc9e339d8e788e82c945603 100644 (file)
@@ -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.
index 95d6a8dd3f5cab3de115d7099a92e59de226bae6..31eb480c0767c9a2357f3dd0fd807a736a07a49a 100644 (file)
@@ -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:
index caf8eabf46e1445ae2f3587622b968afc8595353..96e1cf01b4dcd93bf353d57434142de464cf367c 100644 (file)
@@ -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 (file)
index 0000000..7a33b71
--- /dev/null
@@ -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 (file)
index 0000000..b543ab3
--- /dev/null
@@ -0,0 +1,3 @@
+foo:   .word foo(TARGET2) + 0x1234
+       .word foo + 0xcdef0000(TARGET2)
+       .word (foo + 0x76543210)(TARGET2)
index a2d8cf9306df1a79385eab8113a934bb366346e0..1c00f3e96222f610dab33be119b66d5a11957bc0 100644 (file)
@@ -1,3 +1,10 @@
+2009-07-16  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * 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.
+
 2009-07-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        * ld-ifunc/ifunc.exp: Don't use -shared/-static to build object
index af64e60a2f67794c3c020fe579e18e06cb8667d7..a86dc01643a49bf3582059166ce94a54cdf606d8 100644 (file)
@@ -2,6 +2,6 @@
 .*:     file format.*
 
 Contents of section .text:
- 8000 (04800000|00008004) .*
+ 8000 (10800000|00008010) (44920000|00009244) (1080efcd|cdef8010) (20b25476|7654b220) .*
 # Ignore .ARM.attributes section
 #...
index 1a996f0c202c3cef05283bf4913c2dc3c2aedaf0..34337912f90a263280dd9f98123698ee70e69627 100644 (file)
@@ -2,8 +2,8 @@
 .*:     file format.*
 
 Contents of section .text:
- 8000 (00100000|00001000) .*
+ 8000 (00100000|00001000) (30220000|00002230) (f80fefcd|cdef0ff8) (04425476|76544204) .*
 Contents of section .got:
- 9000 (04800000|00008004) .*
+ 9000 (10800000|00008010) .*
 # Ignore .ARM.attributes section
 #...
index 569d6b595b111ce4a707818b3521d4434ecfe0e3..f81264067346e7accd3d7f5e5fa82655fe9a9d75 100644 (file)
@@ -2,6 +2,6 @@
 .*:     file format.*
 
 Contents of section .text:
- 8000 (04000000|00000004) .*
+ 8000 (10000000|00000010) (40120000|00001240) (0800efcd|cdef0008) (14325476|76543214) .*
 # Ignore .ARM.attributes section
 #...
index 0c343ef6e878e92ab576b0bcc956e7951dc82591..26c451904a291938309618b81b1b9d9dc27a9601 100644 (file)
@@ -3,4 +3,7 @@
        .global _start
 _start:
        .word foo(target2)
+       .word foo+0x1234(target2)
+       .word foo+0xcdef0000(target2)
+       .word foo+0x76543210(target2)
 foo: