X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-mips.c;h=5654fb664e9862bc6224e0e424e72e6e33f7618a;hb=97f50151221de0a023a8317559b1992a90f9cb8f;hp=201c41ae741ed826c2355ec74b55766336b1f913;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 201c41ae74..5654fb664e 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 32-bit ELF - Copyright (C) 1993-2015 Free Software Foundation, Inc. + Copyright (C) 1993-2016 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -107,7 +107,7 @@ static reloc_howto_type elf_mips_howto_table_rel[] = /* No relocation. */ HOWTO (R_MIPS_NONE, /* type */ 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ + 3, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ @@ -1548,9 +1548,9 @@ static reloc_howto_type elf_mips_gnu_rel16_s2 = TRUE); /* pcrel_offset */ /* 32 bit pc-relative. This was a GNU extension used by embedded-PIC. - It was co-opted by mips-linux for exception-handling data. It is no - longer used, but should continue to be supported by the linker for - backward compatibility. (GCC stopped using it in May, 2004.) */ + It was co-opted by mips-linux for exception-handling data. GCC stopped + using it in May, 2004, then started using it again for compact unwind + tables. */ static reloc_howto_type elf_mips_gnu_pcrel32 = HOWTO (R_MIPS_PC32, /* type */ 0, /* rightshift */ @@ -2204,7 +2204,12 @@ mips_elf32_rtype_to_howto (unsigned int r_type, return &elf_micromips_howto_table_rel[r_type - R_MICROMIPS_min]; if (r_type >= R_MIPS16_min && r_type < R_MIPS16_max) return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min]; - BFD_ASSERT (r_type < (unsigned int) R_MIPS_max); + if (r_type >= (unsigned int) R_MIPS_max) + { + (*_bfd_error_handler) (_("Unrecognised MIPS reloc number: %d"), r_type); + bfd_set_error (bfd_error_bad_value); + r_type = R_MIPS_NONE; + } return &elf_mips_howto_table_rel[r_type]; } }