This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch ARM] Fix b / bl ranges for Thumb2.
- From: Richard Earnshaw <Richard dot Earnshaw at buzzard dot freeserve dot co dot uk>
- To: ramana dot radhakrishnan at arm dot com
- Cc: binutils at sourceware dot org, rearnsha at arm dot com, nickc at redhat dot com
- Date: Tue, 22 Dec 2009 01:03:46 +0000
- Subject: Re: [Patch ARM] Fix b / bl ranges for Thumb2.
- References: <1261396921.21534.216.camel@e200593-lin.cambridge.arm.com>
On Mon, 2009-12-21 at 12:02 +0000, Ramana Radhakrishnan wrote:
> Hi,
>
> In stage1 of a bootstrap of GCC in Thumb2 state, I came across a problem
> with unconditional calls going out of range in Thumb2. This was because
> the assembler ends up with encoding a bl within the function with the
> Thumb1 bl instruction rather than the Thumb2 instruction. With some help
> from Richard, I've now fixed this with the attached patch.
>
> This refactors some of the code from md_apply_fix into a separate
> function of its own and rewrites some of the masking code in a form more
> friendly to immediate generation on the ARM.
>
> Tested cross on arm-eabi with no regressions. Ok to commit on trunk and
> backport to the 2.20 branch ?
>
> cheers
> Ramana
>
> 2009-12-21 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
> Richard Earnshaw <richard.earnshaw@arm.com>
>
> * config/tc-arm.c (encode_thumb2_b_bl_offset): New. Refactored
> from md_apply_fix.
> (md_apply_fix): Fixup range checks for Thumb2 version
> of unconditional calls. Call encode_thumb2_b_bl_offset for
> unconditional branches / function calls.
>
>
>
Please also add a regression test for this case.
R.