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]

fix Xtensa assembler for prefixed rsr/xsr/wsr opcodes


This patch fixes a stupid mistake in the Xtensa port of GAS. If the RSR/XSR/WSR opcodes are used with an underscore prefix (to disable assembler transformation), the assembler may add an extra underscore, causing the opcodes not to be recognized. Tested with an xtensa-elf target and committed on the mainline.

2006-03-13 Bob Wilson <bob.wilson@acm.org>

	* config/tc-xtensa.c (xg_translate_sysreg_op): Remove has_underbar
	flag and avoid double underscore prefixes.

Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.58
diff -u -p -r1.58 tc-xtensa.c
--- config/tc-xtensa.c	6 Mar 2006 18:02:06 -0000	1.58
+++ config/tc-xtensa.c	13 Mar 2006 21:44:23 -0000
@@ -2180,14 +2180,10 @@ xg_translate_sysreg_op (char **popname, 
   char *opname, *new_opname;
   const char *sr_name;
   int is_user, is_write;
-  bfd_boolean has_underbar = FALSE;
 
   opname = *popname;
   if (*opname == '_')
-    {
-      has_underbar = TRUE;
-      opname += 1;
-    }
+    opname += 1;
   is_user = (opname[1] == 'u');
   is_write = (opname[0] == 'w');
 
@@ -2233,8 +2229,7 @@ xg_translate_sysreg_op (char **popname, 
   if (is_write && !is_user && !strcasecmp ("interrupt", sr_name))
     sr_name = "intset";
   new_opname = (char *) xmalloc (strlen (sr_name) + 6);
-  sprintf (new_opname, "%s%s.%s", (has_underbar ? "_" : ""),
-	   *popname, sr_name);
+  sprintf (new_opname, "%s.%s", *popname, sr_name);
   free (*popname);
   *popname = new_opname;
 

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