summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-05-07 18:24:48 +0000
committerDaniel Jacobowitz <drow@false.org>2010-05-07 18:24:48 +0000
commit92750f34a6c6194646b606b2dc0f6b987dd35187 (patch)
treef50a6ceeed0f80744c71cdf621a70e8fb5fc5845 /bfd
parent63db82b2932ce7c786605a2b112de8830e83d5d5 (diff)
bfd/
* elf32-arm.c (struct a8_erratum_reloc): Add hash member. Move sym_name to improve packing. (cortex_a8_erratum_scan): Check for PLT entries. (elf32_arm_size_stubs): Save the target symbol for a8 relocs. ld/testsuite/ * ld-arm/cortex-a8-fix-bl-rel-plt.d: New file. * ld-arm/arm-elf.exp (armelftests): Run cortex-a8-fix-bl-rel-plt.d.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-arm.c23
2 files changed, 23 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 915fa22cf8..2302ae4394 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-07 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * elf32-arm.c (struct a8_erratum_reloc): Add hash member. Move
+ sym_name to improve packing.
+ (cortex_a8_erratum_scan): Check for PLT entries.
+ (elf32_arm_size_stubs): Save the target symbol for a8 relocs.
+
2010-05-07 Tristan Gingold <gingold@adacore.com>
* Makefile.in: Regenerate with automake 1.11.1.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 2c24bddc10..18fddc68cc 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2409,9 +2409,10 @@ struct a8_erratum_fix {
struct a8_erratum_reloc {
bfd_vma from;
bfd_vma destination;
+ struct elf32_arm_link_hash_entry *hash;
+ const char *sym_name;
unsigned int r_type;
unsigned char st_type;
- const char *sym_name;
bfd_boolean non_a8_stub;
};
@@ -4101,6 +4102,7 @@ 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. */
@@ -4110,12 +4112,18 @@ cortex_a8_erratum_scan (bfd *input_bfd,
if (entry)
found->non_a8_stub = TRUE;
- if (found->r_type == R_ARM_THM_CALL
- && found->st_type != STT_ARM_TFUNC)
- force_target_arm = TRUE;
- else if (found->r_type == R_ARM_THM_CALL
- && found->st_type == STT_ARM_TFUNC)
- force_target_thumb = TRUE;
+ /* Keep a simpler condition, for the sake of clarity. */
+ if (htab->splt != NULL && found->hash != NULL
+ && found->hash->root.plt.offset != (bfd_vma) -1)
+ use_plt = TRUE;
+
+ if (found->r_type == R_ARM_THM_CALL)
+ {
+ if (found->st_type != STT_ARM_TFUNC || use_plt)
+ force_target_arm = TRUE;
+ else
+ force_target_thumb = TRUE;
+ }
}
/* Check if we have an offending branch instruction. */
@@ -4682,6 +4690,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
a8_relocs[num_a8_relocs].st_type = st_type;
a8_relocs[num_a8_relocs].sym_name = sym_name;
a8_relocs[num_a8_relocs].non_a8_stub = created_stub;
+ a8_relocs[num_a8_relocs].hash = hash;
num_a8_relocs++;
}