Avoid undefined behaviour with signed expressions
authorAlan Modra <amodra@gmail.com>
Tue, 14 Oct 2014 03:06:20 +0000 (13:36 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 14 Oct 2014 04:06:35 +0000 (14:36 +1030)
commit65879393f04e14a9ab8797a8e66e0ec8d94108b5
tree7f4300ec569ff44c6fd1c412f4ddad82d040477c
parent9495b2e66f772783eb89cfa755e1e09641fa44eb
Avoid undefined behaviour with signed expressions

PR 17453
bfd/
* libbfd.c (COERCE16, COERCE32, COERCE64): Use unsigned types.
(EIGHT_GAZILLION): Delete.
binutils/
* dwarf.c (read_leb128): Avoid signed overflow.
(read_debug_line_header): Likewise.
gas/
* config/tc-i386.c (fits_in_signed_long): Use unsigned param and
expression to avoid signed overflow.
(fits_in_signed_byte, fits_in_unsigned_byte, fits_in_unsigned_word,
fits_in_signed_word, fits_in_unsigned_long): Similarly.
* expr.c (operand <'-'>): Avoid signed overflow.
* read.c (s_comm_internal): Likewise.
bfd/ChangeLog
bfd/libbfd.c
binutils/ChangeLog
binutils/dwarf.c
gas/ChangeLog
gas/config/tc-i386.c
gas/expr.c
gas/read.c
gas/write.c