2015-01-06 Nick Clifton <nickc@redhat.com>
PR binutils/17512
+ * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
+ (bfd_perform_relocation): Include the size of the reloc in the
+ test for an out of range relocation.
+ (bfd_generic_get_relocated_section_contents): Remove reloc range
+ test.
+
* coff-i860.c (CALC_ADDEND): Always set an addend value.
* tekhex.c (getvalue): Add an end pointer parameter. Use it to
avoid reading off the end of the buffer.
case 3: return 0;
case 4: return 8;
case 8: return 16;
+ case -1: return 2;
case -2: return 4;
default: abort ();
}
}
/* Is the address of the relocation really within the section? */
- if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
+ if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)
+ /* PR 17512: file: c146ab8b.
+ PR 17512: file: 46dff27f.
+ Include the size of the reloc in the test for out of range addresses. */
+ - bfd_get_reloc_size (howto))
return bfd_reloc_outofrange;
/* Work out which section the relocation is targeted at and the
(*parent)->howto = &none_howto;
r = bfd_reloc_ok;
}
- /* PR 17512: file: c146ab8b. */
- else if ((*parent)->address * bfd_octets_per_byte (abfd)
- >= bfd_get_section_size (input_section))
- r = bfd_reloc_outofrange;
else
r = bfd_perform_relocation (input_bfd,
*parent,