This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Thumb-2 relaxation bugs.
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sourceware dot org
- Date: Fri, 2 Mar 2007 18:21:56 +0000
- Subject: Thumb-2 relaxation bugs.
The attached patch fixes a bug in the Thumb-2 relaxation code.
Under some cuircumstances the size of one instruction may effect teh size of
annother instruction in such a way that a simple iterative relaxation
algorithm will never converge. This typically happens when there are
alignment requirements in addition to range reqtrictions.
The existing code only accounted for cases where the alignment requirement
came from the instruction being relaxed, not from .align directives. The new
code uses a more general algorithm to force use of wide instruction and
guarantee convergence.
While fixing this I also noticed we weren't compensating for the effects of
the current relaxation pass when calculating symbol values. This has also
been fixed.
Tested on arm-none-eabi.
Applied to CVS head.
Paul
2007-03-02 Paul Brook <paul@codesourcery.com>
gas/
* config/tc-arm.c (relax_immediate): Always return positive values.
(relaxed_symbol_addr): New function.
(relax_adr, relax_branch): Use it.
(arm_relax_frag): Pass strect argument. Adjust infinite loop check.
gas/testsuite/
* gas/arm/relax_branch_align.d: New test.
* gas/arm/relax_branch_align.s: New test.
2007-03-02 Paul Brook <paul@codesourcery.com>
gas/
* config/tc-arm.c (relax_immediate): Always return positive values.
(relaxed_symbol_addr): New function.
(relax_adr, relax_branch): Use it.
(arm_relax_frag): Pass strect argument. Adjust infinite loop check.
gas/testsuite/
* gas/arm/relax_branch_align.d: New test.
* gas/arm/relax_branch_align.s: New test.