This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Arm mapping symbols
On Thursday 09 March 2006 16:48, Nick Clifton wrote:
> Hi Paul,
>
> > The Arm compiler generates the obsolete $m, $f and $p mapping symbols in
> > addition to the standard $a, $t and $d.
> > Symbols of the form $<letter>.<anything> are also considered mapping
> > symbols.
>
> Is any letter acceptable or can it only be one of [adfmpt] ? Your patch
> appears to enforce this restriction...
AFAIK only [adfmpt] have ever been used as mapping symbols.
The ARM ELF spec reserves all local symbols starting with $, however only the
names mentioned above have been defined as mapping symbols.
> > Tested with cross to arm-none-eabi.
>
> It would be helpful if you could extend the
> gas/testsuite/gas/arm/mapping.[sd] files to cover these extra symbols,
> so that we can be sure that the assembler and disassembler continue to
> support them.
Binutils does not know or need to know what they actually mean. Nor does it
generate these symbols automatically.
I've added a new test (attached) to check that these symbols are recognised as
special symbols.
Applied to cvs.
Paul
2006-03-09 Paul Brook <paul@codesourcery.com>
bfd/
* cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
mapping symbols.
gas/testsuite/
* gas/arm/nomapping.d: New test.
* gas/arm/nomapping.s: New test.
Index: bfd/cpu-arm.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/bfd/cpu-arm.c,v
retrieving revision 1.19
diff -u -p -r1.19 cpu-arm.c
--- bfd/cpu-arm.c 4 May 2005 15:53:05 -0000 1.19
+++ bfd/cpu-arm.c 8 Mar 2006 19:37:08 -0000
@@ -404,9 +404,12 @@ bfd_arm_get_mach_from_notes (bfd *abfd,
bfd_boolean
bfd_is_arm_mapping_symbol_name (const char * name)
{
+ /* The ARM compiler outputs several obsolete forms. Recognize them
+ in addition to the standard $a, $t and $d. */
return (name != NULL)
&& (name[0] == '$')
- && ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd'))
- && (name[2] == 0);
+ && ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd')
+ || (name[1] == 'm') || (name[1] == 'f') || (name[1] == 'p'))
+ && (name[2] == 0 || name[2] == '.');
}
Index: gas/testsuite/gas/arm/nomapping.d
===================================================================
RCS file: gas/testsuite/gas/arm/nomapping.d
diff -N gas/testsuite/gas/arm/nomapping.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/nomapping.d 9 Mar 2006 17:44:47 -0000
@@ -0,0 +1,8 @@
+#nm: -n
+#name: ARM Mapping Symbols Ignored
+# This test is only valid on ELF based ports.
+#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+
+# Check ARM ELF Mapping Symbols are ignored properly
+0+0 t sym1
+0+c t sym2
Index: gas/testsuite/gas/arm/nomapping.s
===================================================================
RCS file: gas/testsuite/gas/arm/nomapping.s
diff -N gas/testsuite/gas/arm/nomapping.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/nomapping.s 9 Mar 2006 17:43:46 -0000
@@ -0,0 +1,19 @@
+ .text
+ .arm
+sym1:
+ nop
+ .thumb
+ nop
+ nop
+$a.foo:
+$t.foo:
+$d.foo:
+@ Obsolete mapping symbols generated by armcc.
+$m:
+$m.foo:
+$f:
+$f.foo:
+$p:
+$p.foo:
+ .word 0
+sym2: