summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2009-09-07 16:29:34 +0000
committerAndreas Schwab <schwab@suse.de>2009-09-07 16:29:34 +0000
commitc33ca9221e7081ece4ac8319704b77f08c70f78a (patch)
treed81f136678c9ad35563ad9620a808735d08d4506 /bfd
parent5351e9b630e48149d2f65203c54b0bde2796dd79 (diff)
downloadgdb-c33ca9221e7081ece4ac8319704b77f08c70f78a.tar.gz
* elf32-m68k.c (rtype_to_howto): If the reloc index is out of
range call the bfd error hander and use R_68K_NONE instead.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-m68k.c16
2 files changed, 15 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4a5d23562ec..3fd72b41f2e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-07 Andreas Schwab <schwab@linux-m68k.org>
+
+ * elf32-m68k.c (rtype_to_howto): If the reloc index is out of
+ range call the bfd error hander and use R_68K_NONE instead.
+
2009-09-07 Tristan Gingold <gingold@adacore.com>
* po/SRC-POTFILES.in: Regenerate.
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index f85aba00c7e..12379351c4d 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -374,13 +374,17 @@ static reloc_howto_type howto_table[] = {
};
static void
-rtype_to_howto (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
{
- BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_68K_max);
- cache_ptr->howto = &howto_table[ELF32_R_TYPE(dst->r_info)];
+ unsigned int indx = ELF32_R_TYPE (dst->r_info);
+
+ if (indx >= (unsigned int) R_68K_max)
+ {
+ (*_bfd_error_handler) (_("%B: invalid relocation type %d"),
+ abfd, (int) indx);
+ indx = R_68K_NONE;
+ }
+ cache_ptr->howto = &howto_table[indx];
}
#define elf_info_to_howto rtype_to_howto