Use fits_in_signed_long to check x32 addend overflow
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 10 May 2012 03:48:33 +0000 (03:48 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 10 May 2012 03:48:33 +0000 (03:48 +0000)
* config/tc-i386.c (tc_gen_reloc): Use fits_in_signed_long.

gas/ChangeLog
gas/config/tc-i386.c

index 3b43ecd06e8c74af0ddee7b66f1912b7810066cd..f9a6e269fea87e81a6fcfc958cd09638cbe6e0c2 100644 (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
index 06f9764e2282314783bd7b1713f472c98ca8a0ac..ab5233df4ad10da0c3d23d75a13e1d3334eb7387 100644 (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"),
This page took 0.029216 seconds and 4 git commands to generate.