This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] PowerPC select_section / unique_section
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>, David Edelsohn <dje at watson dot ibm dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>, Geoff Keating <geoffk at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 03 Sep 2002 09:27:26 -0700
- Subject: Re: [RFC] PowerPC select_section / unique_section
--On Tuesday, September 03, 2002 10:57:54 AM +0930 Alan Modra
<amodra@bigpond.net.au> wrote:
On Mon, Sep 02, 2002 at 08:57:31PM -0400, David Edelsohn wrote:
To fix the need for GCC to know that it is compiling in PIC mode,
the linuxppc64 and AIX targets can:
1) allow flag_pic to be set on the commandline (creating an artificial
distinction between PIC and non-PIC object files), or
This is the one we want. In our case -fpic doesn't mean "position
independent code", as we're always that sort of PIC. Instead it just
means create code for shared library linking semantics. Note that
-fpic means both PIC code _and_ shared library code generation on
other targets. Which is perhaps unfortunate as they are really two
separate issues.
So why not fix this?
Add -fshared-lib, and have -fpic turn it on. Then, test flag_shared_lib
where you mean that, and flag_pic where you mean that. There's no
compatibility problem for existing code, and on systems where the two
ideas are different, people now have a way of saying which mode they
want.
(You have to notice -fpic -fno_pic which now means something different
than it did before, and warn about that, but that will be a rare case.)
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com