Fix CRX disassembler for 64bit hosts
Nick Clifton
nickc@redhat.com
Mon May 22 11:44:00 GMT 2006
Hi Guys,
I am going to check in the patch below to fix a small problem with
the disassembler for the CRX target when it is running on a 64-bit
host. The EXTRACT macro was assuming that ~0L was the equivalent of
a number with 32 bits set in it, when of course this does not have
to be the case.
Discovered whilst examining crx-elf linker test results, and tested
the same way - it eliminates two unexpected failures.
Cheers
Nick
opcodes/ChangeLog
2006-05-22 Nick Clifton <nickc@redhat.com>
* crx-dis.c (EXTRACT): Make macro work on 64-bit hosts.
Index: opcodes/crx-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/crx-dis.c,v
retrieving revision 1.11
diff -c -3 -p -r1.11 crx-dis.c
*** opcodes/crx-dis.c 7 Jul 2005 19:27:48 -0000 1.11
--- opcodes/crx-dis.c 22 May 2006 08:36:05 -0000
***************
*** 30,36 ****
/* Extract 'n_bits' from 'a' starting from offset 'offs'. */
#define EXTRACT(a, offs, n_bits) \
! (n_bits == 32 ? (((a) >> (offs)) & ~0L) \
: (((a) >> (offs)) & ((1 << (n_bits)) -1)))
/* Set Bit Mask - a mask to set all bits starting from offset 'offs'. */
--- 30,36 ----
/* Extract 'n_bits' from 'a' starting from offset 'offs'. */
#define EXTRACT(a, offs, n_bits) \
! (n_bits == 32 ? (((a) >> (offs)) & 0xffffffffL) \
: (((a) >> (offs)) & ((1 << (n_bits)) -1)))
/* Set Bit Mask - a mask to set all bits starting from offset 'offs'. */
More information about the Binutils
mailing list