This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch ARM] Fix b / bl ranges for Thumb2.


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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]