[PATCH, binutils/ARM] Fix feature checks based on arch value and force review of logic for new arch

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Mon Jun 20 08:54:00 GMT 2016


On Thursday 16 June 2016 16:02:52 mickael guene wrote:
> Hi Thomas,

Hi Mickael,

> 
>    32-bit BL offset is encoded on 24 bits (with lsb set to zero) and
> so biggest value is THM2_MAX_FWD_BRANCH_OFFSET and not
> THM_MAX_FWD_BRANCH_OFFSET.
>    Whereas thumb1 BL offset (two 16 bits instructions, see armv5t) offset
> is encoded on 22 bits (with lsb set to zero) and so biggest value is
> THM_MAX_FWD_BRANCH_OFFSET.

Yes, the important bit is the note in the description of the BL instruction in 
the ARM Architecture Reference Manual. ARMv6-M, despite not having Thumb-2 
technology, has an extended range for the BL instruction.

> 
>    So as now using_thumb2() returns 0 for armv6-m architecture it
> generates veneer for branch offset between THM_MAX_FWD_BRANCH_OFFSET
> and THM2_MAX_FWD_BRANCH_OFFSET whereas it was not the case before
> your patch.

Indeed. As you noticed, using_thumb2 is used to control both the availability 
of that extended BL and the availability of nop.w. Therefore I think your 
solution is the right one. I'll create the patch.

Best regards,

Thomas



More information about the Binutils mailing list