bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/16720] wrong overflow check in R_MIPS_HI16


From: ma.jiang at zte dot com.cn
Subject: [Bug ld/16720] wrong overflow check in R_MIPS_HI16
Date: Mon, 28 Nov 2016 07:29:26 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16720

--- Comment #3 from ma.jiang at zte dot com.cn ---
Hi all,
  This bug still exist in the trunk code. Using the attached files, I can still
get the error "relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'".
This is *NOT* right, as the mips abi said that R_MIPS_HI16 need no overflow
checks. Moreover, Only the o32 abi support R_MIPS_HI16 for _gp_disp, per the
mips abi. R_MIPS_HI16  should never get overflowed, because under o32 abi, the
address width is 32.
  So, I think we should just get rid of the overflow check for R_MIPS_HI16.
Here is the patch for trunk.
--- bfd/elfxx-mips.c.orig       2016-11-28 23:09:23.343671301 +0800
+++ bfd/elfxx-mips.c    2016-11-28 23:23:49.452670956 +0800
@@ -5875,7 +5875,6 @@ mips_elf_calculate_relocation (bfd *abfd
            value = mips_elf_high (addend + gp - p - 1);
          else
            value = mips_elf_high (addend + gp - p);
-         overflowed_p = mips_elf_overflow_p (value, 16);
        }
       break;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]