[patch ob] Disallow -pie and -static
Cary Coutant
ccoutant@google.com
Mon Feb 27 20:56:00 GMT 2012
>> Again, we could define what -static -pie means, but that definition
>> would include defining how the linker is supposed to handle the option
>> combination.
>
> i don't see why -pie should require PT_DYNAMIC or PT_INTERP. -static controls
> those aspects.
>
> with the compiler driver, -pie would be used to select the appropriate startup
> objects -- Scrt1.o/crt{begin,end}S.o/etc... vs crt1.o/crt{begin,end}.o/etc...
I'd have chimed in earlier, but have nothing to say that Ian hasn't
already said.
You can argue about what -static -pie should mean, but there's no
definition for it today, and no spec for the linker to follow.
Fundamentally, a PIE is going to need dynamic relocations, and there's
going to need to be some mechanism in the ABI that tells the linker
how to pass those to the runtime. Today, that mechanism involves
PT_DYNAMIC and the dynamic linker. Until that changes, -pie is
incompatible with -static.
-cary
More information about the Binutils
mailing list