linux-mips
[Top] [All Lists]

Re: Static variables and "gp"

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: Static variables and "gp"
From: Johannes Stezenbach <js@convergence.de>
Date: Mon, 3 Mar 2003 13:54:17 +0100
Cc: Gilad Benjamini <yaelgilad@myrealbox.com>, linux-mips@linux-mips.org
In-reply-to: <20030302121820.A30790@linux-mips.org>
Mail-followup-to: Johannes Stezenbach <js@convergence.de>, Ralf Baechle <ralf@linux-mips.org>, Gilad Benjamini <yaelgilad@myrealbox.com>, linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1046596048.d43b0c00yaelgilad@myrealbox.com> <20030302121820.A30790@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.3i
On Sun, Mar 02, 2003 at 12:18:20PM +0100, Ralf Baechle wrote:
> On Sun, Mar 02, 2003 at 09:07:28AM +0000, Gilad Benjamini wrote:
> 
> > How can I force a specific static variable to be used by the "gp" register
> > rather than by a two-step load ?
> > Compiling a mips-linux using gcc.
> 
> That feature doesn't work in gcc for userspace code ...

It works with diet libc (http://dietlibc.org/).
You need a static, non-PIC libgcc.a which supports it, though,
which means a bit of gcc config hackery...

Regards,
Johannes

<Prev in Thread] Current Thread [Next in Thread>