From: H.J. Lu Date: Thu, 10 May 2012 03:48:33 +0000 (+0000) Subject: Use fits_in_signed_long to check x32 addend overflow X-Git-Tag: sid-snapshot-20120601~270 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83acd3e879271522628c834171c3e52c041c90cc;p=thirdparty%2Fbinutils-gdb.git Use fits_in_signed_long to check x32 addend overflow * config/tc-i386.c (tc_gen_reloc): Use fits_in_signed_long. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 3b43ecd06e8..f9a6e269fea 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2012-05-09 H.J. Lu + + * config/tc-i386.c (tc_gen_reloc): Use fits_in_signed_long. + 2012-05-09 H.J. Lu * config/tc-i386.c (tc_gen_reloc): Check x32 addend overflow diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 06f9764e228..ab5233df4ad 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -9175,8 +9175,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) { case BFD_RELOC_64: /* Check addend overflow. */ - if ((long long) fixp->fx_offset > 0x7fffffffLL - || (long long) fixp->fx_offset < -0x80000000LL) + if (!fits_in_signed_long (fixp->fx_offset)) { as_bad_where (fixp->fx_file, fixp->fx_line, _("cannot represent relocation %s with addend %lld in x32 mode"),