[PATCH, binutils, ARM] Fix Thumb-2 BL detection

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Wed Jun 29 09:22:00 GMT 2016


Commit 60a019a089177f3f58f636580857414d769b8c11 (Fix feature checks based on 
ARM architecture value) fixed the logic in using_thumb2 () to detect what 
architecture have Thumb-2 technology. However, that function was also use to 
detect the availability of Thumb-2 BL which is available in all post-ARMv6T2 
architecture, including ARMv6-M. This patch introduces a new function 
using_thumb2_bl () to detect availability of this instruction and changes the 
place depending on this information to use this new function instead of 
using_thumb2 (). It also adds a patch to check that the logic works for ARMv6-
M.

ChangeLog entries are as follow:

*** bfd/ChangeLog ***

2016-06-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * 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/ChangeLog ***

2016-06-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * 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.


binutils testsuite run did not show any regression, nor did GCC testsuite when 
running it for ARM7TDMI (pre-ARMv6T2 Thumb-1), Cortex-M0 (Thumb-1 with Thumb-2 
BL) and Cortex-M3 (Thumb-2).

Is this ok for master branch?

Best regards.

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_thumb2_bl_detection.patch
Type: text/x-patch
Size: 4674 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160629/d6b499f7/attachment.bin>


More information about the Binutils mailing list