From 3d7cf019981b42d62549fe26d6ce1604a7e068f1 Mon Sep 17 00:00:00 2001 From: Gunther Nikl Date: Sat, 7 Mar 2009 19:28:21 +0000 Subject: [PATCH] (amiga_perform_reloc): Catch baserelative relocations against code symbols. (aout_perform_reloc): Likewise. --- bfd/amigaoslink.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bfd/amigaoslink.c b/bfd/amigaoslink.c index 06bcbda..9067a0a 100644 --- a/bfd/amigaoslink.c +++ b/bfd/amigaoslink.c @@ -467,6 +467,12 @@ amiga_perform_reloc (abfd, r, data, sec, obfd, error_message) "section %s, reloc to symbol %s",sec->name,sym->name); ret=bfd_reloc_notsupported; } + else if ((target_section->flags&SEC_CODE)!=0) + { + bfd_msg ("%s: baserelative text relocation to \"%s\"", + abfd->filename, sym->name); + ret=bfd_reloc_notsupported; + } else { /* If target->out is .bss, add the value of the .data section to @@ -663,6 +669,12 @@ aout_perform_reloc (abfd, r, data, sec, obfd, error_message) "section %s, reloc to symbol %s",sec->name,sym->name); ret=bfd_reloc_notsupported; } + else if ((target_section->flags&SEC_CODE)!=0) + { + bfd_msg ("%s: baserelative text relocation to \"%s\"", + abfd->filename, sym->name); + ret=bfd_reloc_notsupported; + } else /* Target section and sec need not be the same.. */ { /* If target->out is .bss, add the value of the .data section to