linux-mips
[Top] [All Lists]

Re: Setting up of GP in static, non-PIC version of glibc?

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: Setting up of GP in static, non-PIC version of glibc?
From: Jay Carlson <nop@nop.com>
Date: Tue, 26 Feb 2002 09:55:30 -0500
Cc: Jay Carlson <nop@nop.com>, Hartvig Ekner <hartvige@mips.com>, linux-mips@oss.sgi.com
In-reply-to: <20020226125532.B7497@dea.linux-mips.net>
Sender: owner-linux-mips@oss.sgi.com

On Tuesday, February 26, 2002, at 06:55 AM, Ralf Baechle wrote:

On Tue, Feb 26, 2002 at 12:10:50AM -0500, Jay Carlson wrote:

By default non-PIC code *does* use $gp due to the brain damage in gas;
gas defaults to -G 8 unless told otherwise (-KPIC implies -G0 so we
don't see this in PIC code.)  gcc won't know anything about this, of
course.

What I'm doing in SUBTARGET_ASM_SPEC is to write something like
"%{fno-pic: %{!G: -G0}}"--if we're not in PIC mode, pass -G0 to gas by
default.

Anyway, once that's straightened out, -G8 does appear to work the way
you'd expect, with the code that Hartvig pasted above---I had written a
byte-for-byte identical patch :-)

I agree on that one except that 64kB of small data no longer seem to be
sufficient for every common application in the world.  So I'd vote for a
more defensive choice of the -G value, that is 0.

Right.  In my ideal world, here's how it would work:

cc1 defaults to -G0.  I think we have that now.

gas defaults to -G0. Messing with SUBTARGET_ASM_SPEC has that effect for people who use the gcc driver, but anybody invoking gas directly will still hit this problem, but too bad.

So I think the primary constituency for gas defaulting to -G8 are existing cygnuhhhh I mean redhat embedded MIPS customers, outside of Linux; that's who we should check with before we change the default.

Jay


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