Subject: Re: Revision K strongarms ...
To: Philip Blundell <pb@nexus.co.uk>
From: None <kim@pvv.ntnu.no>
List: port-arm32
Date: 05/07/1998 15:05:48
> Consider this code:
>
> ldr r0, 2f
> ...
>
> 2: .word 0xc0ffee
>
> Now, as it stands the assembler will resolve the label and convert the LDR
> into a constant PC-relative instruction without emitting a reloc. If that
> code happens to cross a page boundary then the linker has no way to know that
> it now has to fix up the LDR when it inserts the NOP.
Argh.
So the linker must be able to know which instructions use
addresses. Possible, but some work.
As a first fix, one might let the linker put a NOP at the end of every
page. The addresses would then be easier to calculate.
NewAddress = OldAddress*PageSize/(PageSize - WordSize)
The efficiency lost would be WordSize/Pagesize, on the order
of 1/2000, which still is acceptable.
Kim0