diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-04-09 15:37:56 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-04-09 15:37:56 +0000 |
commit | 856be61a57035c72b0d76988ca15dddedcbf0019 (patch) | |
tree | 245bb5ef59f257a3b4deedcfc1ff84cba67b8c9c /bfd/elf32-i386.c | |
parent | 474b9b1a4f75f88223da007b1b6a78c96627050c (diff) | |
download | binutils-redhat-856be61a57035c72b0d76988ca15dddedcbf0019.tar.gz |
Return relocation error on unsupported relocation.
2011-04-09 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_relocate_section): Return relocation
error on unsupported relocation.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 1b76cb4a45..acabeb31f4 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -3451,7 +3451,11 @@ elf_i386_relocate_section (bfd *output_bfd, sreloc = elf_section_data (input_section)->sreloc; - BFD_ASSERT (sreloc != NULL && sreloc->contents != NULL); + if (sreloc == NULL || sreloc->contents == NULL) + { + r = bfd_reloc_notsupported; + goto check_relocation_error; + } loc = sreloc->contents; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel); @@ -4096,6 +4100,7 @@ do_relocation: contents, rel->r_offset, relocation, 0); +check_relocation_error: if (r != bfd_reloc_ok) { const char *name; |