[patch] adjust libgloss addresses for 64-bit

Maciej W. Rozycki macro@linux-mips.org
Fri Apr 15 10:32:00 GMT 2005


On Fri, 15 Apr 2005, Thiemo Seufer wrote:

> > Here's another shot at this. The problem that we encounter is that for
> > 64-bit addresses "la" (or dla for that matter) does not sign extend the
> > constant passed in the case of:
> > 
> > la $2,0x80000000
> > 
> > leaving us with a zero-extended value in a register which is
> > unpredictable as far as the standard (and at least one chip out there)

 Hmm, 0x80000000 should be a valid XKUSEG address...

> > is concerned. One option would be to modify the assembler to
> > automatically sign-extend when in the presence of constants that are
> > smaller than a single register.
> 
> I think la should load a proper address for 32bit address space, even
> when used in code with 64bit addresses. That's the most useful
> behaviour for it.

 So what should "la $2,0x80000000($3)" do when using 64-bit addresses?  
Replace/supplement the offset with a symbol as suitable...

  Maciej



More information about the Binutils mailing list