This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Committed: fix PR gas/2101 - misassembly of hex constants in mmixal notation
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: binutils at sourceware dot org
- Date: Tue, 3 Jan 2006 01:11:57 -0500 (EST)
- Subject: Committed: fix PR gas/2101 - misassembly of hex constants in mmixal notation
A stupid thinko on my part. Thanks to Martin Ruckert (email
withheld) for reporting this. Martin listed a couple of other
similar error cases that I couldn't repeat but which are in the
test-file below. There'll be a separate PR if any case remains.
gas/testsuite:
PR gas/2101
* gas/mmix/hex2.s, gas/mmix/hex2.d: New test.
gas:
PR gas/2101
* config/tc-mmix.c (mmix_handle_mmixal): Don't treat #[0-9][FB] as
a local-label reference.
Index: testsuite/gas/mmix/hex2.d
===================================================================
RCS file: testsuite/gas/mmix/hex2.d
diff -N testsuite/gas/mmix/hex2.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gas/mmix/hex2.d 3 Jan 2006 05:51:01 -0000
@@ -0,0 +1,17 @@
+# objdump: -dr
+.*: file format elf64-mmix
+
+Disassembly of section \.text:
+
+0+ <Main>:
+[ ]+0:[ ]+fd000000[ ]+swym 0,0,0
+[ ]+4:[ ]+e309001f[ ]+setl \$9,0x1f
+[ ]+8:[ ]+e3081b2f[ ]+setl \$8,0x1b2f
+[ ]+c:[ ]+e307ff9f[ ]+setl \$7,0xff9f
+[ ]+10:[ ]+e3061f3a[ ]+setl \$6,0x1f3a
+[ ]+14:[ ]+e305001b[ ]+setl \$5,0x1b
+[ ]+18:[ ]+e3041a1b[ ]+setl \$4,0x1a1b
+[ ]+1c:[ ]+e303009f[ ]+setl \$3,0x9f
+[ ]+20:[ ]+e302009b[ ]+setl \$2,0x9b
+[ ]+24:[ ]+e301001f[ ]+setl \$1,0x1f
+[ ]+28:[ ]+e300001b[ ]+setl \$0,0x1b
Index: testsuite/gas/mmix/hex2.s
===================================================================
RCS file: testsuite/gas/mmix/hex2.s
diff -N testsuite/gas/mmix/hex2.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gas/mmix/hex2.s 3 Jan 2006 05:51:01 -0000
@@ -0,0 +1,15 @@
+x:
+ swym
+0:
+ setl $9,#1F
+1:
+ setl $8,#1B2F
+ setl $7,0xFF9F
+ setl $6,#1F3A
+9:
+ setl $5,#1B
+ setl $4,#1A1B
+ setl $3,0x9F
+ setl $2,0x9B
+ setl $1,0x1F
+ setl $0,0x1b
Index: config/tc-mmix.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mmix.c,v
retrieving revision 1.25
diff -p -u -r1.25 tc-mmix.c
--- config/tc-mmix.c 7 Jun 2005 17:54:17 -0000 1.25
+++ config/tc-mmix.c 3 Jan 2006 05:53:31 -0000
@@ -3077,7 +3077,9 @@ mmix_handle_mmixal (void)
{
if ((s[1] != 'B' && s[1] != 'F')
|| is_part_of_name (s[-1])
- || is_part_of_name (s[2]))
+ || is_part_of_name (s[2])
+ /* Don't treat e.g. #1F as a local-label reference. */
+ || (s != input_line_pointer && s[-1] == '#'))
s++;
else
{
brgds, H-P