diff options
author | Julian Brown <julian@codesourcery.com> | 2010-08-25 12:37:30 +0000 |
---|---|---|
committer | Julian Brown <julian@codesourcery.com> | 2010-08-25 12:37:30 +0000 |
commit | 4563a8602899e7270a6a0d8dd5da822c6680c6ba (patch) | |
tree | f83589c91b69bda3d30bf76c4739ed0f1a77563b /bfd | |
parent | 6f0341784b508d7c4d015b18b20a35c8d8917273 (diff) | |
download | gdb-4563a8602899e7270a6a0d8dd5da822c6680c6ba.zip gdb-4563a8602899e7270a6a0d8dd5da822c6680c6ba.tar.gz gdb-4563a8602899e7270a6a0d8dd5da822c6680c6ba.tar.bz2 |
bfd/
* elf32-arm.c (arm_stub_required_alignment): New.
(arm_build_one_stub): Use above to partition stubs.
(make_branch_to_a8_stub): Use arm_stub_a8_veneer_lwm not
arm_stub_a8_veneer_b_cond.
ld/testsuite/
* ld-arm/arm-elf.exp (armelftests): Add cortex-a8-fix-blx-bcond.s.
* ld-arm/cortex-a8-fix-blx-bcond.s: New.
* ld-arm/cortex-a8-fix-blx-bcond.d: New.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 37 |
2 files changed, 40 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3dc8434..dc696e7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2010-08-25 Julian Brown <julian@codesourcery.com> + + * elf32-arm.c (arm_stub_required_alignment): New. + (arm_build_one_stub): Use above to partition stubs. + (make_branch_to_a8_stub): Use arm_stub_a8_veneer_lwm not + arm_stub_a8_veneer_b_cond. + 2010-08-25 Alan Modra <amodra@gmail.com> * aout-arm.c (MY(bfd_reloc_type_lookup)): Use bfd_arch_bits_per_address. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 0cd1e64..390c0af 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3475,6 +3475,36 @@ static bfd_reloc_status_type elf32_arm_final_link_relocate Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *, const char *, int, struct elf_link_hash_entry *, bfd_boolean *, char **); +static unsigned int +arm_stub_required_alignment (enum elf32_arm_stub_type stub_type) +{ + switch (stub_type) + { + case arm_stub_a8_veneer_b_cond: + case arm_stub_a8_veneer_b: + case arm_stub_a8_veneer_bl: + return 2; + + case arm_stub_long_branch_any_any: + case arm_stub_long_branch_v4t_arm_thumb: + case arm_stub_long_branch_thumb_only: + case arm_stub_long_branch_v4t_thumb_thumb: + case arm_stub_long_branch_v4t_thumb_arm: + case arm_stub_short_branch_v4t_thumb_arm: + case arm_stub_long_branch_any_arm_pic: + case arm_stub_long_branch_any_thumb_pic: + case arm_stub_long_branch_v4t_thumb_thumb_pic: + case arm_stub_long_branch_v4t_arm_thumb_pic: + case arm_stub_long_branch_v4t_thumb_arm_pic: + case arm_stub_long_branch_thumb_only_pic: + case arm_stub_a8_veneer_blx: + return 4; + + default: + abort (); /* Should be unreachable. */ + } +} + static bfd_boolean arm_build_one_stub (struct bfd_hash_entry *gen_entry, void * in_arg) @@ -3506,9 +3536,8 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, stub_sec = stub_entry->stub_sec; if ((globals->fix_cortex_a8 < 0) - != (stub_entry->stub_type >= arm_stub_a8_veneer_lwm)) - /* We have to do the a8 fixes last, as they are less aligned than - the other veneers. */ + != (arm_stub_required_alignment (stub_entry->stub_type) == 2)) + /* We have to do less-strictly-aligned fixes last. */ return TRUE; /* Make a note of the offset within the stubs for this entry. */ @@ -13356,7 +13385,7 @@ make_branch_to_a8_stub (struct bfd_hash_entry *gen_entry, data = (struct a8_branch_to_stub_data *) in_arg; if (stub_entry->target_section != data->writing_section - || stub_entry->stub_type < arm_stub_a8_veneer_b_cond) + || stub_entry->stub_type < arm_stub_a8_veneer_lwm) return TRUE; contents = data->contents; |