+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.
+
2011-04-09 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/12657
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);
contents, rel->r_offset,
relocation, 0);
+check_relocation_error:
if (r != bfd_reloc_ok)
{
const char *name;
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;
+ }
elf_append_rela (output_bfd, sreloc, &outrel);
contents, rel->r_offset,
relocation, rel->r_addend);
+check_relocation_error:
if (r != bfd_reloc_ok)
{
const char *name;
else
{
(*_bfd_error_handler)
- (_("%B(%A+0x%lx): reloc against `%s': error %d"),
+ (_("%B(%A+0x%lx): reloc against `%s': error %r"),
input_bfd, input_section,
(long) rel->r_offset, name, (int) r);
return FALSE;