This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How should gcc handle "-shared -pie" and "-pie -shared"?
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Eric Christopher <echristo at apple dot com>, binutils at sourceware dot org, gcc at gcc dot gnu dot org
- Date: Tue, 3 Jul 2007 12:05:56 -0700
- Subject: How should gcc handle "-shared -pie" and "-pie -shared"?
- References: <je8x9xr4w3.fsf@sykes.suse.de> <20070703133306.GA7129@lucon.org> <je4pklr36l.fsf@sykes.suse.de> <20070703174858.GA426@lucon.org> <je4pkl8j4v.fsf@sykes.suse.de> <20070703180734.GA529@lucon.org> <jey7hx733i.fsf@sykes.suse.de> <4D4A4A3C-E4B3-4C7B-865F-264473A5B989@apple.com> <20070703184215.GA709@lucon.org> <je6451midm.fsf@sykes.suse.de>
On Tue, Jul 03, 2007 at 08:50:29PM +0200, Andreas Schwab wrote:
> "H.J. Lu" <hjl@lucon.org> writes:
>
> > Where is it documented.
>
> Nowhere.
>
> > Gcc 4.3 just passes "-shared -pie" to linker. I don't see gcc driver
> > remove -pie.
>
> Look at the use of Scrt1.o. It's much of a mess.
>
Gcc currently ignores -pie when there is a -shared due to treatment
of Scrt1.o. However, this behavior is undocumted. We like to
match the linker behavior with gcc.
Is this gcc behavior intentional? Will this gcc behavior ever
change? Can we document this gcc behavior?
BTW, this is another problem which can be handled like:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26885
H.J.