diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2009-09-07 16:29:34 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2009-09-07 16:29:34 +0000 |
commit | c86ad51492bb4a4c70c540643a163970ae0f7944 (patch) | |
tree | c8d9e13302e2158eaa450207e424b0b19a0df340 /bfd/elf32-m68k.c | |
parent | 815c0482cbdf89fce2ac7d4d8df9908fcac2e1a0 (diff) | |
download | gdb-c86ad51492bb4a4c70c540643a163970ae0f7944.zip gdb-c86ad51492bb4a4c70c540643a163970ae0f7944.tar.gz gdb-c86ad51492bb4a4c70c540643a163970ae0f7944.tar.bz2 |
* 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/elf32-m68k.c')
-rw-r--r-- | bfd/elf32-m68k.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index f85aba0..1237935 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 |