This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

On Wed, May 10, 2006 at 04:04:42PM +0100, Thiemo Seufer wrote:
> > 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.

I don't think we're communicating.

drow@caradoc:~% cat a.s
        jal 0x10000000
drow@caradoc:~% /space/fsf/mips/install/bin/mips64-linux-as a.s
a.s: Assembler messages:
a.s:1: Error: jump address range overflow (0x10000000)

So... how can the assembler know that?  If you link the file into an
executable such that a.o(.text) is at 0x10000010, then the jal does not

Daniel Jacobowitz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]