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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user