This is the mail archive of the
binutils@sourceware.org
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: binutils at sourceware dot org
- Cc: mickael guene <mickael dot guene at st dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Mon, 27 Jun 2016 16:51:58 +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> <5762B18C dot 7070204 at st dot com> <4231866 dot vWXfb0XcSC at e108577-lin>
On Monday 20 June 2016 09:52:25 Thomas Preudhomme wrote:
> 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.
Just to let you know that I already got a patch and testing is ongoing (for
ARMv4T, ARMv6-M and ARMv7-M). I shall have something by tomorrow evening.
Best regards,
Thomas