X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-mt.c;h=7bfa18e0bd1a6e706adc494744ea0359ca56d36c;hb=64d2901806c171c0d949f8fb1b29b4e5ba8cf04d;hp=6df1521e7d122c4b311e13bbc0abb13614b2a79f;hpb=6d00b590316c0b08de21a264893b0fd627c54686;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c index 6df1521e7d..7bfa18e0bd 100644 --- a/bfd/elf32-mt.c +++ b/bfd/elf32-mt.c @@ -1,5 +1,5 @@ /* Morpho Technologies MT specific support for 32-bit ELF - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -48,8 +48,8 @@ static reloc_howto_type mt_elf_howto_table [] = /* This reloc does nothing. */ HOWTO (R_MT_NONE, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ + 3, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ @@ -236,6 +236,11 @@ mt_info_to_howto_rela unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); + if (r_type >= (unsigned int) R_MT_max) + { + _bfd_error_handler (_("%B: invalid MT reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & mt_elf_howto_table [r_type]; }