From 728b2f2114e9b43d4b7bbb4bb56b022469a9df3f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 8 Dec 2004 20:27:50 +0000 Subject: [PATCH] * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26 overflow. --- bfd/ChangeLog | 5 +++++ bfd/elfxx-mips.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 38e9a439143..672f1896051 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2004-12-08 Ian Lance Taylor + + * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26 + overflow. + 2004-12-07 Ben Elliston * netbsd-core.c (netbsd_core_file_p): Make `i' unsigned. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index fcbe6d3415e..ae553b4cb46 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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; -- 2.30.2