diff options
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 035d584dff..faf18d0044 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -4556,6 +4556,7 @@ cortex_a8_erratum_scan (bfd *input_bfd, bfd_vma target; enum elf32_arm_stub_type stub_type = arm_stub_none; struct a8_erratum_reloc key, *found; + bfd_boolean use_plt = FALSE; key.from = base_vma + i; found = (struct a8_erratum_reloc *) @@ -4567,7 +4568,6 @@ cortex_a8_erratum_scan (bfd *input_bfd, { char *error_message = NULL; struct elf_link_hash_entry *entry; - bfd_boolean use_plt = FALSE; /* We don't care about the error returned from this function, only if there is glue or not. */ @@ -4671,6 +4671,12 @@ cortex_a8_erratum_scan (bfd *input_bfd, offset = (bfd_signed_vma) (found->destination - pc_for_insn); + /* If the stub will use a Thumb-mode branch to a + PLT target, redirect it to the preceding Thumb + entry point. */ + if (stub_type != arm_stub_a8_veneer_blx && use_plt) + offset -= PLT_THUMB_STUB_SIZE; + target = pc_for_insn + offset; /* The BLX stub is ARM-mode code. Adjust the offset to |