* elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26
authorIan Lance Taylor <ian@airs.com>
Wed, 8 Dec 2004 20:27:50 +0000 (20:27 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 8 Dec 2004 20:27:50 +0000 (20:27 +0000)
overflow.

bfd/ChangeLog
bfd/elfxx-mips.c

index 38e9a4391438959529aa785528612c26011c7a7d..672f1896051e73dabd7691896f6196876f1a8540 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-08  Ian Lance Taylor  <ian@wasabisystems.com>
+
+       * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26
+       overflow.
+
 2004-12-07  Ben Elliston  <bje@gnu.org>
 
        * netbsd-core.c (netbsd_core_file_p): Make `i' unsigned.
index fcbe6d3415e1d51b245d15aa8774e0b3b75cfd9a..ae553b4cb46df178a1b0231178727608953cdafa 100644 (file)
@@ -3350,7 +3350,10 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
       if (local_p)
        value = ((addend | ((p + 4) & 0xf0000000)) + symbol) >> 2;
       else
-       value = (_bfd_mips_elf_sign_extend (addend, 28) + symbol) >> 2;
+       {
+         value = (_bfd_mips_elf_sign_extend (addend, 28) + symbol) >> 2;
+         overflowed_p = (value >> 26) != ((p + 4) >> 28);
+       }
       value &= howto->dst_mask;
       break;