public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] Arm mapping symbols
@ 2006-03-08 19:53 Paul Brook
  2006-03-09 16:37 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2006-03-08 19:53 UTC (permalink / raw)
  To: binutils

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.

The patch below tweaks BFD to recognise these additional forms.

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

2006-03-08  Paul Brook  <paul@codesourcery.com>

	* cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
	mapping symbols.

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] == '.');
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Arm mapping symbols
  2006-03-08 19:53 [patch] Arm mapping symbols Paul Brook
@ 2006-03-09 16:37 ` Nick Clifton
  2006-03-09 23:06   ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2006-03-09 16:37 UTC (permalink / raw)
  To: Paul Brook; +Cc: binutils

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...


> 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.


> 2006-03-08  Paul Brook  <paul@codesourcery.com>
> 
> 	* cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
> 	mapping symbols.

Approved - please apply.

Cheers
    Nick



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Arm mapping symbols
  2006-03-09 16:37 ` Nick Clifton
@ 2006-03-09 23:06   ` Paul Brook
  2006-03-10  9:50     ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2006-03-09 23:06 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

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.

[-- Attachment #2: patch.arm_mapping --]
[-- Type: text/x-diff, Size: 1918 bytes --]

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:

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Arm mapping symbols
  2006-03-09 23:06   ` Paul Brook
@ 2006-03-10  9:50     ` Nick Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2006-03-10  9:50 UTC (permalink / raw)
  To: Paul Brook; +Cc: binutils

Hi Paul,

>>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.

Well, it does need to know that they are "special" even if it does not 
have to know why they are special.

> I've added a new test (attached) to check that these symbols are recognised as 
> special symbols.

Thanks for doing this.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-10  9:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-08 19:53 [patch] Arm mapping symbols Paul Brook
2006-03-09 16:37 ` Nick Clifton
2006-03-09 23:06   ` Paul Brook
2006-03-10  9:50     ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).