From 5e866f5aeeaf7514f5ca4f9eaba41594eac22e5b Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 1 Jul 2016 16:13:25 +0100 Subject: Fix Thumb-2 BL detection 2016-07-01 Thomas Preud'homme bfd/ * elf32-arm.c (using_thumb2_bl): New function. (arm_type_of_stub): Declare thumb2 variable together and change type to bfd_boolean. Use using_thumb2_bl () to determine whether THM_MAX_FWD_BRANCH_OFFSET or THM2_MAX_FWD_BRANCH_OFFSET should be checked for BL range. (elf32_arm_final_link_relocate): Use using_thumb2_bl () to determine the bit size of BL offset. ld/ * testsuite/ld-arm/arm-elf.exp (Thumb-2 BL): Assemble for ARMv7. (Thumb-2 BL on ARMv6-M): New testcase. * testsuite/ld-arm/thumb2-bl.d: Do not try to match testcase filename. * testsuite/ld-arm/thumb2-bl.s: Do not select architecture. --- ld/ChangeLog | 7 +++++++ ld/testsuite/ld-arm/arm-elf.exp | 5 ++++- ld/testsuite/ld-arm/thumb2-bl.d | 2 +- ld/testsuite/ld-arm/thumb2-bl.s | 1 - 4 files changed, 12 insertions(+), 3 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 5f2e6cd..f53a2ed 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2016-07-01 Thomas Preud'homme + + * testsuite/ld-arm/arm-elf.exp (Thumb-2 BL): Assemble for ARMv7. + (Thumb-2 BL on ARMv6-M): New testcase. + * testsuite/ld-arm/thumb2-bl.d: Do not try to match testcase filename. + * testsuite/ld-arm/thumb2-bl.s: Do not select architecture. + 2016-07-01 Tristan Gingold * NEWS: Add marker for 2.27. diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index a5d4c87..597bdcf 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -604,9 +604,12 @@ set armeabitests_nonacl { {{objdump -d fix-arm1176-off.d}} "fix-arm1176-6"} - {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "" {thumb2-bl.s} + {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv7" {thumb2-bl.s} {{objdump -dr thumb2-bl.d}} "thumb2-bl"} + {"Thumb-2 BL on ARMv6-M" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv6-m" {thumb2-bl.s} + {{objdump -dr thumb2-bl.d}} + "thumb2-armv6m-bl"} {"Thumb-2 Interworked branch" "-T arm.ld" "" "" {thumb2-b-interwork.s} {{objdump -dr thumb2-b-interwork.d}} "thumb2-b-interwork"} diff --git a/ld/testsuite/ld-arm/thumb2-bl.d b/ld/testsuite/ld-arm/thumb2-bl.d index 298a044..8dab0c0 100644 --- a/ld/testsuite/ld-arm/thumb2-bl.d +++ b/ld/testsuite/ld-arm/thumb2-bl.d @@ -1,5 +1,5 @@ -.*thumb2-bl: file format elf32-.*arm.* +.*: file format elf32-.*arm.* Disassembly of section .text: diff --git a/ld/testsuite/ld-arm/thumb2-bl.s b/ld/testsuite/ld-arm/thumb2-bl.s index ddb1cd3..80af810 100644 --- a/ld/testsuite/ld-arm/thumb2-bl.s +++ b/ld/testsuite/ld-arm/thumb2-bl.s @@ -1,7 +1,6 @@ @ Test to ensure that a Thumb-2 BL works with an offset that is @ not permissable for Thumb-1. - .arch armv7 .global _start .syntax unified -- cgit v1.1