[committed] Fix dwarf2 register name to number on hppa

John David Anglin dave@hiauly1.hia.nrc.ca
Tue Sep 9 00:57:00 GMT 2008


In looking at the CFI code, I noticed that the register name to number
code was wrong for 32-bit hppa targets.  Corrected as follows.

Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2008-09-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* config/tc-hppa.c (hppa_regname_to_dw2regnum): Add register name to
	number support for 32-bit targets.

Index: config/tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.141
diff -u -3 -p -r1.141 tc-hppa.c
--- config/tc-hppa.c	28 Aug 2008 02:33:45 -0000	1.141
+++ config/tc-hppa.c	8 Sep 2008 23:14:18 -0000
@@ -8676,9 +8676,19 @@ hppa_regname_to_dw2regnum (char *regname
     {
       p = regname + 2;
       regnum = strtoul (p, &q, 10);
+#if TARGET_ARCH_SIZE == 64
       if (p == q || *q || regnum <= 4 || regnum >= 32)
 	return -1;
       regnum += 32 - 4;
+#else
+      if (p == q
+	  || (*q  && ((*q != 'L' && *q != 'R') || *(q + 1)))
+	  || regnum <= 4 || regnum >= 32)
+	return -1;
+      regnum = (regnum - 4) * 2 + 32;
+      if (*q == 'R')
+	regnum++;
+#endif
     }
   return regnum;
 }



More information about the Binutils mailing list