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

Bug in ARM assembler....


Hi guys,

The ARM assembler is not assembling the following instruction
correctly.

        mrs     lr, spsr

It seems the string pointer is advanced to far before the check to set
the SPSR bit.  The following patch needs to go into the mainline and 
the branch.  Is it ok to install?

Scott

Thu Jun 01 2000  Scott Bambrough <scottb@netwinder.org>

        * config/tc-arm.c (do_mrs): Allow SPSR_BIT to be set correctly.

Index: tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.43
diff -u -p -r1.43 tc-arm.c
--- tc-arm.c    2000/05/15 19:25:22     1.43
+++ tc-arm.c    2000/06/01 18:39:28
@@ -1914,6 +1914,8 @@ do_mrs (str, flags)
      char *str;
      unsigned long flags;
 {
+  int skip = 0;
+  
   /* Only one syntax.  */
   skip_whitespace (str);
 
@@ -1936,11 +1938,11 @@ do_mrs (str, flags)
         /* Lower case versions for backwards compatability.  */
       || strcmp (str, "cpsr") == 0
       || strcmp (str, "spsr") == 0)
-    str += 4;
+    skip = 4;
   /* This is for backwards compatability with older toolchains.  */
   else if (strcmp (str, "cpsr_all") == 0
           || strcmp (str, "spsr_all") == 0)
-    str += 7;
+    skip = 7;
   else
     {
       inst.error = _("{C|S}PSR expected");
@@ -1949,6 +1951,7 @@ do_mrs (str, flags)
 
   if (* str == 's' || * str == 'S')
     inst.instruction |= SPSR_BIT;
+  str += skip;
   
   inst.instruction |= flags;
   end_of_line (str);

-- 
Scott Bambrough - Software Engineer
REBEL.COM    http://www.rebel.com
NetWinder    http://www.netwinder.org

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