[PATCH] Relax MIPS j/jal out-of-range check

Daniel Jacobowitz drow@false.org
Tue May 9 16:11:00 GMT 2006


On Tue, May 09, 2006 at 10:43:51AM -0400, Paul Koning wrote:
> >>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
> 
>  Daniel> On Tue, May 09, 2006 at 03:16:37PM +0100, Thiemo Seufer
>  Daniel> wrote:
>  >> Hello All,
>  >> 
>  >> I applied the appended patch. It relaxes the range checking for j
>  >> and jal addresses to a warning, since there are a few cases where
>  >> the effect of an out of range jump can be the intended result.
> 
>  Daniel> Why?  Especially bearing in mind that we're in the assembler
>  Daniel> here.  This doesn't make sense to me.
> 
> If you have a routine that's sometimes called from uncached code, and
> the label is a KSEG0 address, you could call it from KSEG1 code simply
> with
> 	jal	label
> and the machine will do the right thing (you end up at the KSEG1
> address corresponding to "label").

How could you get the assembler to do this?  Normally you can't tell if
this is going to overflow until you've linked!  Linker errors are a
different kettle of fish.

I think the warning is just bogus, after looking at it.  We're warning
for "jal 0x10000000".  But we don't know the location of the jal yet,
so we haven't a clue if it's out of range, do we?


-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list