This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH, binutils/ARM] Fix feature checks based on arch value and force review of logic for new arch
- From: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- To: mickael guene <mickael dot guene at st dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 20 Jun 2016 09:52:25 +0100
- Subject: Re: [PATCH, binutils/ARM] Fix feature checks based on arch value and force review of logic for new arch
- Authentication-results: sourceware.org; auth=none
- References: <1877488 dot cBokx9mdiu at e108577-lin> <19045910 dot SPt8PspXUT at e108577-lin> <5762B18C dot 7070204 at st dot com>
On Thursday 16 June 2016 16:02:52 mickael guene wrote:
> Hi Thomas,
> 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
> 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
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.