This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Relax MIPS j/jal out-of-range check
Daniel Jacobowitz wrote:
[snip]
> > 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?
The patch is correct, but our explanation was misleading: The code
checks for absolute addresses, and warns now if it crosses a 256 MB
memory area. This allows e.g. to jump between KSEG0 and KSEG1 without
hassles.
Thiemo