When defining a constant too long for the size specified, the warning message
itself may truncate the original value on some platforms.
For example, this code:
On x86-64, GAS correctly displays:
**** Warning:value 0x1234567890 truncated to 0x7890
Whereas on x86, GAS displays:
**** Warning:value 0x34567890 truncated to 0x34567890
It should be easy to fix it by making sure that the longest integer is used (see
Created attachment 2001 [details]
This fix should work for most platforms.
Ahem, on x86, GAS displays:
**** Warning:value 0x34567890 truncated to 0x7890
The current binutils in CVS shows
[hjl@gnu-9 big-1]$ cat x.s
[hjl@gnu-9 big-1]$ make
./as -o x.o x.s
x.s: Assembler messages:
x.s:1: Warning: bignum truncated to 2 bytes
HJ, I think you closed this bug too soon. On a 32-bit host, binutils configured
with 64-bit bfd support will behave as reported.
Thanks for the bug report and fix. I have applied your suggested patch.