This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How to add 'relaxing' to loader for m68k
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- Cc: binutils at sources dot redhat dot com, Peter dot Barada at Motorola dot com
- Date: Tue, 9 Apr 2002 09:09:31 +0930
- Subject: Re: How to add 'relaxing' to loader for m68k
- References: <200204081631.g38GV2Z17166@hyper.wm.sps.mot.com>
On Mon, Apr 08, 2002 at 12:31:02PM -0400, Peter Barada wrote:
>
> I'm looking at trying to shrink out some code space in the
> m68k/coldfire ports, and I'm noticing linked code that looks like:
>
> 4fc: 4879 0000 5921 pea 5921 <_foo+0x11>
> 502: 61ff 0000 11ca bsrl 16ce <puts>
> 508: 61ff 0000 2144 bsrl 264e <breakpoint>
>
> This could be changed to use word offsets for the bsr's:
[snip]
> And then the pea could be changed to use absolute short addressing:
[snip]
>
> What's the best way to go about this? Does the assembler create
> enough reloacation records to allow for proper relaxation (bsrl->bsrw
> relaxation between a conditional branch and its target, etc)?
You'll need to modify the asembler to emit relocs for code that is
normally fully resolved by the assembler, eg. branches to local
labels, because their offsets may change if intervening code is
relaxed.
--
Alan Modra
IBM OzLabs - Linux Technology Centre