This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch ob] Disallow -pie and -static


On Monday 27 February 2012 18:38:44 Ian Lance Taylor wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
> > if an ELF is linked with -static, then there's no ldso and thus no
> > PT_INTERP needed.
> 
> And then, on current GNU/Linux systems, it is not a PIE.

i don't think so.  a PIE is a Position Independent Executable.  that doesn't 
mean it needs an interpreter.  just that its loadable sections can get loaded 
at any address and still work.

> > i don't see why -pie should require PT_DYNAMIC or PT_INTERP.
> 
> Because without PT_DYNAMIC and PT_INTERP, on current GNU/Linux systems,
> the executable won't work.

you're correct about PT_DYNAMIC, but i don't think PT_INTERP.  as Joseph said, 
we pretty much do this today with the ldso (ignoring the lack of pre-packaged 
startup objects for any PIE to utilize).

> You seem to be speaking at some sort of conceptual level.  At the
> conceptual level, you are correct.  It is possible to define some sort
> of static PIE.  But there is no such thing today, and implementing it
> will require changes to the linker.  When it is implemented, we will
> change the linker such that -pie -static is not an error.

and i'm asking, what are those changes that the linker needs ?

this isn't entirely conceptual.  the Gentoo hardened project (and to a lesser 
degree, ChromiumOS) builds everything with either -fPIC or -fPIE.  so all the 
objects going into a static ELF have been built with the position independent 
overhead, so it's kind of sad that we can't go that little extra bit so the 
final ELF is a proper static PIE.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]