From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4085 invoked by alias); 14 Apr 2005 22:38:08 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 4044 invoked from network); 14 Apr 2005 22:38:02 -0000 Received: from unknown (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org with SMTP; 14 Apr 2005 22:38:02 -0000 Received: from port-195-158-168-78.dynamic.qsc.de ([195.158.168.78] helo=hattusa.textio) by mx01.qsc.de with esmtp (Exim 3.35 #1) id 1DMCyA-0006Bj-00; Fri, 15 Apr 2005 00:37:54 +0200 Received: from ths by hattusa.textio with local (Exim 4.50) id 1DMCyA-0002mC-EO; Fri, 15 Apr 2005 00:37:54 +0200 Date: Thu, 14 Apr 2005 22:38:00 -0000 To: Eric Christopher Cc: newlib@sources.redhat.com, binutils@sources.redhat.com, cgd@broadcom.com Subject: Re: [patch] adjust libgloss addresses for 64-bit Message-ID: <20050414223754.GI32470@hattusa.textio> References: <1113516346.4591.39.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1113516346.4591.39.camel@localhost.localdomain> User-Agent: Mutt/1.5.9i From: Thiemo Seufer X-SW-Source: 2005-04/txt/msg00396.txt.bz2 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