This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[arm] Alter R_ARM_TARGET2 for SymbianOS


The patch below changes the meaning of R_ARM_TARGET2 to R_ARM_ABS32 for 
SymbianOS targets.

Tested with cross to arm-none-symbianos and built --targets=all.
Ok?

Paul

2004-09-20  Paul Brook  <paul@codesourcery.com>

bfd/
 * elf32-arm.h (bfd_elf32_arm_set_target_relocs): Handle "abs"
 target2 relocation type.
ld/
 * ld.texinfo: Document --target2=abs.
 * emulparms/armsymbian.sh (TARGET2_TYPE): Set.
ld/testsuite/
 * ld-arm/arm-elf.exp: Add test for --target2=abs.
 * ld-arm/arm-target2-abs.d: New file.

Index: bfd/elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.144
diff -u -p -r1.144 elf32-arm.h
--- bfd/elf32-arm.h 17 Sep 2004 12:34:54 -0000 1.144
+++ bfd/elf32-arm.h 20 Sep 2004 00:32:49 -0000
@@ -925,6 +925,8 @@ bfd_elf32_arm_set_target_relocs (struct 
   globals->target1_is_rel = target1_is_rel;
   if (strcmp (target2_type, "rel") == 0)
     globals->target2_reloc = R_ARM_REL32;
+  else if (strcmp (target2_type, "abs") == 0)
+    globals->target2_reloc = R_ARM_ABS32;
   else if (strcmp (target2_type, "got-rel") == 0)
     globals->target2_reloc = R_ARM_GOT_PREL;
   else
Index: ld/ld.texinfo
===================================================================
RCS file: /cvs/src/src/ld/ld.texinfo,v
retrieving revision 1.121
diff -u -p -r1.121 ld.texinfo
--- ld/ld.texinfo 17 Sep 2004 12:18:16 -0000 1.121
+++ ld/ld.texinfo 20 Sep 2004 00:32:56 -0000
@@ -4922,7 +4922,9 @@ The @samp{--target2=type} switch overrid
 meanings, and target defaults are as follows:
 @table @samp
 @item rel
-@samp{R_ARM_REL32} (arm*-*-symbianelf, arm*-*-elf, arm*-*-eabi)
+@samp{R_ARM_REL32} (arm*-*-elf, arm*-*-eabi)
+@item abs
+@samp{R_ARM_ABS32} (arm*-*-symbianelf)
 @item got-rel
 @samp{R_ARM_GOT_PREL} (arm*-*-linux, arm*-*-*bsd)
 @end table
Index: ld/emulparams/armsymbian.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/armsymbian.sh,v
retrieving revision 1.3
diff -u -p -r1.3 armsymbian.sh
--- ld/emulparams/armsymbian.sh 13 Sep 2004 14:14:31 -0000 1.3
+++ ld/emulparams/armsymbian.sh 20 Sep 2004 00:32:56 -0000
@@ -5,6 +5,7 @@ OUTPUT_FORMAT="elf32-littlearm-symbian"
 BIG_OUTPUT_FORMAT="elf32-bigarm-symbian"
 LITTLE_OUTPUT_FORMAT="$OUTPUT_FORMAT"
 TARGET1_IS_REL=1
+TARGET2_TYPE=abs
 
 # This value should match ELF_MAXPAGESIZE in BFD.  Otherwise, elf.c
 # will not place read-write sections in a separate ELF segment from
Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/arm-elf.exp,v
retrieving revision 1.4
diff -u -p -r1.4 arm-elf.exp
--- ld/testsuite/ld-arm/arm-elf.exp 17 Sep 2004 12:18:18 -0000 1.4
+++ ld/testsuite/ld-arm/arm-elf.exp 20 Sep 2004 00:32:57 -0000
@@ -56,6 +56,9 @@ set armelftests {
     {"target2-rel" "-static --target2=rel -T arm.ld" "" {arm-target2.s}
      {{objdump -s arm-target2-rel.d}}
      "arm-target2-rel"}
+    {"target2-abs" "-static --target2=abs -T arm.ld" "" {arm-target2.s}
+     {{objdump -s arm-target2-abs.d}}
+     "arm-target2-abs"}
     {"target2-got-rel" "-static --target2=got-rel -T arm.ld" 
"" {arm-target2.s}
      {{objdump -s arm-target2-got-rel.d}}
      "arm-target2-got-rel"}
Index: ld/testsuite/ld-arm/arm-target2-abs.d
===================================================================
RCS file: ld/testsuite/ld-arm/arm-target2-abs.d
diff -N ld/testsuite/ld-arm/arm-target2-abs.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-arm/arm-target2-abs.d 20 Sep 2004 00:32:57 -0000
@@ -0,0 +1,5 @@
+
+.*:     file format.*
+
+Contents of section .text:
+ 8000 (04800000|00008004) .*


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]