This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[COMMIT] 64-bit host fox for CRX gas
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Fri, 10 Feb 2006 12:29:40 +0000
- Subject: [COMMIT] 64-bit host fox for CRX gas
Hi Guys,
One more 64-bit host fix, this time for GAS for the crx-elf target.
The check_range() function was checking a 32-bit value as if it was
a 64-bit value and so getting confused by negative numbers. This
patch fixes that. Tested by building a crx-elf toolchain and
running the binutils and gcc testsuites.
Cheers
Nick
gas/ChangeLog
2006-02-10 Nick Clifton <nickc@redhat.com>
* config/tc-crx.c (check_range): Ensure that the sign bit of a
32-bit value is propagated into the upper bits of a 64-bit long.
Index: gas/config/tc-crx.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-crx.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 tc-crx.c
*** gas/config/tc-crx.c 14 Jul 2005 15:34:16 -0000 1.16
--- gas/config/tc-crx.c 10 Feb 2006 12:10:41 -0000
*************** check_range (long *num, int bits, int un
*** 1378,1383 ****
--- 1378,1389 ----
long upper_64kb = 0xFFFF0000;
long value = *num;
+ /* For hosts witah longs bigger than 32-bits make sure that the top
+ bits of a 32-bit negative value read in by the parser are set,
+ so that the correct comparisons are made. */
+ if (value & 0x80000000)
+ value |= (-1L << 31);
+
/* Verify operand value is even. */
if (flags & OP_EVEN)
{