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: Thiemo Seufer <ths at networkno dot de>
- To: Eric Christopher <erchrist at cisco dot com>
- Cc: newlib at sources dot redhat dot com, binutils at sources dot redhat dot com,cgd at broadcom dot com
- Date: Fri, 15 Apr 2005 00:37:54 +0200
- Subject: Re: [patch] adjust libgloss addresses for 64-bit
- References: <1113516346.4591.39.camel@localhost.localdomain>
Eric Christopher 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)
> 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.
> Not a bad idea, but we should also just be precise in what we pass as
> well. Since gas will accept sign extended constants from la when we're
> using a 64-bit pointers we can probably get by with this patch as well.
FWIW, the Linux kernel uses this approach for a while now.
Thiemo