Patch to correct LINK_PIE_SPEC

Peter S. Mazinger ps.m@gmx.net
Mon Nov 15 16:56:00 GMT 2004


On Mon, 15 Nov 2004, Daniel Jacobowitz wrote:

> On Mon, Nov 15, 2004 at 01:52:10PM +0100, Peter S. Mazinger wrote:
> > On Mon, 15 Nov 2004, Jakub Jelinek wrote:
> > 
> > > On Mon, Nov 15, 2004 at 01:30:36PM +0100, Peter S. Mazinger wrote:
> > > > > 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
> > > > 
> > > > No I certainly don't want to, and if I want to, then I'll provide a way 
> > > > for it.
> > > > 
> > > > > 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.
> 
> BTW, Jakub, I noticed recently that -nostartfiles is redundant in this
> case.  It has been as far back as I checked in GCC; it's implied by
> -nostdlib.  So if you feel like shortening those command lines...
> 
> > > > 
> > > > that is really glibc's problem ;)
> > > 
> > > No, it is a bug introduced by your patch.
> > 
> > well, if only glibc is involved, I don't understand why it should be my 
> > patch's bug
> 
> Please read the documentation of the options whose behavior you are
> changing.
> 
> `-nostartfiles'
>      Do not use the standard system startup files when linking.  The
>      standard system libraries are used normally, unless `-nostdlib' or
>      `-nodefaultlibs' is used.
> 
> `-nostdlib'
>      Do not use the standard system startup files or libraries when
>      linking.  No startup files and only the libraries you specify will
>      be passed to the linker.
> 
> Where do you see any justification for these options affecting the
> linker arguments, other than libraries or startfiles?

Sorry, I do not change nostdlib/nostartfiles behaviour, I use these as
exclusion for -pie. If we provide -nostartfiles, the Scrt1.o file won't be 
provided and a PIE executable can't be built

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2



More information about the Gcc-patches mailing list