summaryrefslogtreecommitdiffstats
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-05-06 10:21:32 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2011-05-06 10:21:32 +0000
commit7d24e6a65a15d57859faadac48cd1cfa79f1b94d (patch)
tree716b57b4eadbe7141184c8ac08e45de0ecb354e3 /bfd/elf32-arm.c
parent1342dcfc8294c553c3f1f67652b306a1b1573533 (diff)
downloadppe42-binutils-7d24e6a65a15d57859faadac48cd1cfa79f1b94d.tar.gz
ppe42-binutils-7d24e6a65a15d57859faadac48cd1cfa79f1b94d.zip
bfd/
* elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb branch to a PLT entry, redirect it to the PLT's Thumb entry point. ld/testsuite/ * ld-arm/cortex-a8-fix-b-plt.s, ld-arm/cortex-a8-fix-b-plt.d, ld-arm/cortex-a8-fix-bcc-plt.s, ld-arm/cortex-a8-fix-bcc-plt.d, ld-arm/cortex-a8-fix-bl-plt.s, ld-arm/cortex-a8-fix-bl-plt.d, ld-arm/cortex-a8-fix-blx-plt.s, ld-arm/cortex-a8-fix-blx-plt.d, ld-arm/cortex-a8-fix-plt.ld: New tests. * ld-arm/arm-elf.exp: Run them.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c8
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
OpenPOWER on IntegriCloud