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 CRX disassembler for 64bit hosts


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'.  */


  


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