This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: [patch] adjust libgloss addresses for 64-bit
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Thiemo Seufer <ths at networkno dot de>
- Cc: Eric Christopher <erchrist at cisco dot com>, newlib at sources dot redhat dot com,binutils at sources dot redhat dot com, cgd at broadcom dot com
- Date: Fri, 15 Apr 2005 11:32:02 +0100 (BST)
- Subject: Re: [patch] adjust libgloss addresses for 64-bit
- References: <1113516346.4591.39.camel@localhost.localdomain><20050414223754.GI32470@hattusa.textio>
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