2
0
mirror of https://frontier.innolan.net/github/amigaos-binutils.git synced 2025-11-21 21:14:14 +00:00

Add missing sanity check for pc-relative references from a.out objects.

This check was already present for references from hunk objects.

* bfd/amigaoslink.c (aout_perform_reloc): For pc-relative references only
  references to the same output section are permitted.
This commit is contained in:
Gunther Nikl
2015-05-25 12:39:35 +00:00
parent 4e19233665
commit 3da84a8d63

View File

@ -644,7 +644,12 @@ aout_perform_reloc (abfd, r, data, sec, obfd, error_message)
case H_PC32:
if (bfd_is_abs_section(target_section)) /* Ref to absolute hunk */
relocation=sym->value;
else
else if (sec->output_section!=target_section->output_section) /* Error */
{
DPRINT(5,("pc relative, but out-of-range\n"));
ret=bfd_reloc_outofrange;
}
else /* Same section */
{
relocation = sym->value + target_section->output_offset
- sec->output_offset;