This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH][ARM] Make hex constants consistent in disassembly on 32-bit and 64-bit hosts.
- From: =?big5?b?RG91ZyBLd2FuICjD9q62vHcp?= <dougkwan at google dot com>
- To: binutils at sourceware dot org
- Date: Thu, 9 Jul 2009 17:21:23 -0700
- Subject: [PATCH][ARM] Make hex constants consistent in disassembly on 32-bit and 64-bit hosts.
Hi,
This patch fixes 3 gas test breakages on 64-bit hosts due to the
fact that the upper 32-bits of a long type is printed in hexadecimal
output. This is tested on x86_64-unknown-linux-gnu with binaries
compiled in 64-bit and 32-bit modes.
-Doug
2009-07-09 Doug Kwan <dougkwan@google.com>
* arm-disc.c (print_insn_coprocessor, print_insn_asm): Print only
lower 32 bits of constants to make output consistent on both 32-bit
and 64-bit hosts.
----------------
Index: opcodes/arm-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arm-dis.c,v
retrieving revision 1.102
diff -u -p -r1.102 arm-dis.c
--- opcodes/arm-dis.c 7 Jul 2009 16:15:27 -0000 1.102
+++ opcodes/arm-dis.c 9 Jul 2009 23:34:50 -0000
@@ -1955,7 +1955,7 @@ print_insn_coprocessor (bfd_vma pc,
break;
case 'x':
- func (stream, "0x%lx", value);
+ func (stream, "0x%lx", (value & 0xffffffffUL));
break;
case '`':
@@ -2167,7 +2167,7 @@ print_insn_coprocessor (bfd_vma pc,
}
if (value_in_comment > 32 || value_in_comment < -16)
- func (stream, "\t; 0x%lx", value_in_comment);
+ func (stream, "\t; 0x%lx", (value_in_comment & 0xffffffffUL));
return TRUE;
}
@@ -3107,7 +3107,7 @@ print_insn_arm (bfd_vma pc, struct disas
}
if (value_in_comment > 32 || value_in_comment < -16)
- func (stream, "\t; 0x%lx", value_in_comment);
+ func (stream, "\t; 0x%lx", (value_in_comment & 0xffffffffUL));
return;
}
}