Use fits_in_signed_long to check x32 addend overflow

* config/tc-i386.c (tc_gen_reloc): Use fits_in_signed_long.
This commit is contained in:
H.J. Lu 2012-05-10 03:48:33 +00:00
parent 8cf0d2dd21
commit 83acd3e879
2 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2012-05-09 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (tc_gen_reloc): Use fits_in_signed_long.
2012-05-09 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (tc_gen_reloc): Check x32 addend overflow

View file

@ -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"),