This is the mail archive of the binutils@sourceware.org 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]

[patch] Arm BE8 mode and mapping sybols


When building a section code map we are only interested in $a, $t and $d 
mapping symbols. bfd_is_arm_mapping_symbol_name can return true for other 
(obsolete) mapping symbols.  The attached patch makes sure these are ignored.

Tested with cross to arm-none-eabi.
Ok?

Paul

2006-05-05  Paul Brook  <paul@codesourcery.com>

bfd/
	* elf32-arm.c (elf32_arm_output_symbol_hook): Ignore everything but
	a, t and d symbols.
ld/testsuite/
	* ld-arm/arm-be8.d: New test.
	* ld-arm/arm-be8.s: New test.
	* ld-arm/arm-elf.exp: Add arm-be8.
Index: bfd/elf32-arm.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/bfd/elf32-arm.c,v
retrieving revision 1.73
diff -u -p -r1.73 elf32-arm.c
--- bfd/elf32-arm.c	3 May 2006 14:26:40 -0000	1.73
+++ bfd/elf32-arm.c	5 May 2006 17:10:09 -0000
@@ -7789,8 +7789,9 @@ elf32_arm_output_symbol_hook (struct bfd
   if (!globals->byteswap_code)
     return TRUE;
 
-  /* We only want mapping symbols.  */
-  if (! bfd_is_arm_mapping_symbol_name (name))
+  /* We only want 'a', 't' and 'd' mapping symbols.  */
+  if (! bfd_is_arm_mapping_symbol_name (name)
+      || (name[1] != 'a' && name[1] != 't' && name[1] != 'd'))
     return TRUE;
 
   /* If this section has not been allocated an _arm_elf_section_data
Index: ld/testsuite/ld-arm/arm-be8.d
===================================================================
RCS file: ld/testsuite/ld-arm/arm-be8.d
diff -N ld/testsuite/ld-arm/arm-be8.d
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-arm/arm-be8.d	5 May 2006 21:38:32 -0000
@@ -0,0 +1,8 @@
+
+.*:     file format.*
+
+Contents of section .text:
+ 8000 0000a0e3 1eff2fe1 c0467047 fcfffff7 .*
+ 8010 12345678                            .*
+# Ignore .ARM.attributes section
+#...
Index: ld/testsuite/ld-arm/arm-be8.s
===================================================================
RCS file: ld/testsuite/ld-arm/arm-be8.s
diff -N ld/testsuite/ld-arm/arm-be8.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-arm/arm-be8.s	5 May 2006 18:06:32 -0000
@@ -0,0 +1,14 @@
+.arch armv6
+.text
+arm:
+mov r0, #0
+$m:
+bx lr
+.thumb
+.thumb_func
+thumb:
+nop
+bx lr
+bl thumb
+data:
+.word 0x12345678
Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
RCS file: /var/cvsroot/src-cvs/src/ld/testsuite/ld-arm/arm-elf.exp,v
retrieving revision 1.12
diff -u -p -r1.12 arm-elf.exp
--- ld/testsuite/ld-arm/arm-elf.exp	2 May 2006 13:09:18 -0000	1.12
+++ ld/testsuite/ld-arm/arm-elf.exp	5 May 2006 18:03:00 -0000
@@ -122,6 +122,9 @@ set armelftests {
     {"thumb-rel32" "-static -T arm.ld" "" {thumb-rel32.s}
      {{objdump -s thumb-rel32.d}}
      "thumb-rel32"}
+    {"BE8 Mapping Symbols" "-static -T arm.ld -EB --be8" "-EB" {arm-be8.s}
+     {{objdump -s arm-be8.d}}
+     "arm-be8"}
 }
 
 run_ld_link_tests $armelftests

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