mirror of
https://github.com/bebbo/amigaos-binutils-2.14.git
synced 2025-12-08 22:38:24 +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:
@ -644,7 +644,12 @@ aout_perform_reloc (abfd, r, data, sec, obfd, error_message)
|
|||||||
case H_PC32:
|
case H_PC32:
|
||||||
if (bfd_is_abs_section(target_section)) /* Ref to absolute hunk */
|
if (bfd_is_abs_section(target_section)) /* Ref to absolute hunk */
|
||||||
relocation=sym->value;
|
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
|
relocation = sym->value + target_section->output_offset
|
||||||
- sec->output_offset;
|
- sec->output_offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user