[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PIE support

From: Ralf Wildenhues
Subject: Re: PIE support
Date: Wed, 30 Nov 2005 21:11:03 +0100
User-agent: Mutt/1.5.9i

* Paul Jakma wrote on Wed, Nov 30, 2005 at 07:10:30PM CET:
> On Tue, 29 Nov 2005, Ralf Wildenhues wrote:
> >see ). Or, 
> >to not avoid further namespace invasion, maybe `-DPIC -DLT_PIE'. 
> >For CC and CXX tags?  Suggestions?  Maybe only add -DPIC?
> >
> >One weak reason against adding anything would be the fact that
> >non-libtool created PIE objects would not see the define either.  :-/
> >(Actually, that could be interpreted as reason for the program author
> >to rely on __PIC__ or __pic__ iff this is gcc-specific code anyway.)
> Why not leave the define to GCC?

Because: when one day 100 compilers support this, they may use 10
different #defines for this notion.  Or not, who knows.

> You pointed out gcc sets defines for 
> PIC. That would work for the non-libtool-compiled object case too.

Yes, but most packages using libtool won't ever need to compile a
PIC object without libtool's help.  Unlike PIE, when you do
CFLAGS=-fpie.  Which in turn is what we're trying to settle on,
currently.  (Well, I am at least ;)

> Ie any problems arise here will be due to missing functionality in 
> GCC, and likely remedied there in due course as PIE becomes more 
> commonly used.

Sure.  As long as you stick with GCC and GNU ld, there won't be any
issues.  If libtool were to specialize on those two only, it'd be fair
to say there is little point in having a thing such as libtool at all.

> >Well.  It's implemented in GNU binutils ld as of recently enough, 
> >GCC as of recently enough, and with them is said to work on all ELF 
> >systems.
> Interesting to know.

Well, that's what the GCC and ld documentation state.

> I just tried with GCC 3.4.3 as supplied with 
> SNV_09 and, while it accepted -fpie -pie on the commandline, the 
> resulting executable was not reported as relocatable by 'file'.

Well, the more interesting question would probably be the GNU ld version
you used, and on what hardware.

> >My tests with gcc-3.4.4 show that -fpie/-fPIE always override 
> >-fpic/-fPIC, independent of the order in which they were passed. 
> >(What an unfortunate choice, by the way.  Oh well.)
> Indeed. I think that has been discussed on the gcc lists.

I could not find such discussion (I searched before reporting the bug
upstream).  Could you point me to it?  Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]