This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to correct LINK_PIE_SPEC
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "Peter S. Mazinger" <ps dot m at gmx dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Nov 2004 06:56:30 -0500
- Subject: Re: Patch to correct LINK_PIE_SPEC
- References: <Pine.LNX.4.44.0411151215060.18055-200000@lnx.bridge.intra>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 15, 2004 at 12:27:02PM +0100, Peter S. Mazinger wrote:
> Hello!
>
> The attached patch corrects the conditions, when the pie option should we
> "propagated" to ld. It uses the same condition as later in the
> link_command section, where the startfile and the endfile are applied.
>
> ChangeLog:
> 2004-11-15 Peter S. Mazinger <ps.m@gmx.net>
> * gcc.c (LINK_PIE_SPEC): Add %{!A:%{!nostdlib:%{!nostartfiles: }}}
This is incorrect.
When you specify -nostdlib or -nostartfiles, you certainly want -pie
being passed down to ld if given to gcc. These options tell the compiler
that you are taking care of using the appropriate start files and/or libraries.
Not passing -pie here would be very surprising and likely breaks
e.g. glibc which heavily uses -nostdlib and -nostartfiles and uses -pie
too.
Jakub