Commit: Allow bignums to specify byte values
Nick Clifton
nickc@redhat.com
Wed Mar 16 11:33:00 GMT 2016
Hi Guys,
I am checking in the patch below to fix a problem with gas's parsing
of .byte values that are so large that they need a bignum to hold
them. (This can happen in particular with negative byte values
generated by the compiler, if the compiler insists upon generating
large hex values for all constants. *cough* RX port *cough*).
The problem was that the code that checks for a bignum overflowing the
data container into which it is being placed had no code to handle the
special case of a single byte. Since a byte is smaller than the
LITTLENUM type, extra care must taken to mask and check the top bits
of the first generic_bignum array entry.
Anyway the patch takes care of this problem, and a small, related
problem in the RX parser, which means that the RX assembler can now
properly handle bignum constants generated by gcc, even if the
assembler is running on a 32-bit host.
The patch includes a small testcase to make sure that the
functionality continues to work.
Tested with lots and lots of different toolchains.
Cheers
Nick
gas/ChangeLog
2016-03-16 Nick Clifton <nickc@redhat.com>
* read.c (emit_expr_with_reloc): Add code check a bignum with
nbytes == 1.
* config/rx/rx-parse.y (rx_intop): Accept bignum values for sizes
other than 32-bits.
* testsuite/gas/elf/bignum.s: New test source file.
* testsuite/gas/elf/bignum.d: New test driver file.
* testsuite/gas/elf/elf.exp: Run the new test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas.bignums.check.patch
Type: text/x-patch
Size: 4281 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160316/c5609776/attachment.bin>
More information about the Binutils
mailing list