+2013-11-14 Nick Clifton <nickc@redhat.com>
+
+ PR ld/16017
+ * elf32-arm.c (elf32_arm_populate_plt_entry): Return a boolean
+ value, TRUE for success, FALSE for failure.
+ Fail if attempting to create a PLT entry for a thumb only target.
+ (elf32_arm_final_link_relocate): Check result of calling
+ elf32_arm_populate_plt_entry.
+ (elf32_arm_finish_dynamic_symbol): Likewise.
+
2013-11-14 Guy Martin <gmsoft@tuxicoman.be>
PR ld/16082
ROOT_PLT points to the offset of the PLT entry from the start of its
section (.iplt or .plt). ARM_PLT points to the symbol's ARM-specific
- bookkeeping information. */
+ bookkeeping information.
-static void
+ Returns FALSE if there was a problem. */
+
+static bfd_boolean
elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
union gotplt_union *root_plt,
struct arm_plt_info *arm_plt,
| (tail_displacement & 0x00ffffff),
ptr + 12);
}
+ else if (using_thumb_only (htab))
+ {
+ /* PR ld/16017: Do not generate ARM instructions for
+ the PLT if compiling for a thumb-only target.
+
+ FIXME: We ought to be able to generate thumb PLT instructions... */
+ _bfd_error_handler (_("%B: Warning: thumb mode PLT generation not currently supported"),
+ output_bfd);
+ return FALSE;
+ }
else
{
/* Calculate the displacement between the PLT slot and the
loc = srel->contents + plt_index * RELOC_SIZE (htab);
SWAP_RELOC_OUT (htab) (output_bfd, &rel, loc);
}
+
+ return TRUE;
}
/* Some relocations map to different relocations depending on the
plt_offset--;
else
{
- elf32_arm_populate_plt_entry (output_bfd, info, root_plt, arm_plt,
- -1, dynreloc_value);
- root_plt->offset |= 1;
+ if (elf32_arm_populate_plt_entry (output_bfd, info, root_plt, arm_plt,
+ -1, dynreloc_value))
+ root_plt->offset |= 1;
+ else
+ return bfd_reloc_notsupported;
}
/* Static relocations always resolve to the .iplt entry. */
if (!eh->is_iplt)
{
BFD_ASSERT (h->dynindx != -1);
- elf32_arm_populate_plt_entry (output_bfd, info, &h->plt, &eh->plt,
- h->dynindx, 0);
+ if (! elf32_arm_populate_plt_entry (output_bfd, info, &h->plt, &eh->plt,
+ h->dynindx, 0))
+ return FALSE;
}
if (!h->def_regular)