public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PING: [PATCH] Add -static-pie to GCC driver to create static PIE
@ 2017-08-17 13:43 H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2017-08-17 13:43 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: GCC Patches

On Wed, Aug 9, 2017 at 3:39 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Aug 8, 2017 at 10:36 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On August 9, 2017 12:18:41 AM GMT+02:00, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
>>>This patch adds -static-pie to GCC driver to create static PIE.  A
>>>static
>>>position independent executable (PIE) is similar to static executable,
>>>but can be loaded at any address without a dynamic linker.  All linker
>>>input files must be compiled with -fpie or -fPIE and linker must
>>>support
>>>--no-dynamic-linker to avoid linking with dynamic linker.  "-z text" is
>>>also needed to prevent dynamic relocations in read-only segments.
>>>
>>>OK for trunk?
>>
>> What's wrong with -static -pie?
>>
>
> -static -pie behaved differently depending on if --enable-default-pie
> was used:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81523
>
> I just checked in a patch to make -static always  override -pie.
>

Hi Joseph,

Can you take a look at

https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00638.html

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* PING: [PATCH] Add -static-pie to GCC driver to create static PIE
@ 2017-09-07 15:10 H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2017-09-07 15:10 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GCC Patches

On Mon, Aug 28, 2017 at 10:13 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Aug 28, 2017 at 9:10 AM, Joseph Myers <joseph@codesourcery.com> wrote:
>> On Tue, 8 Aug 2017, H.J. Lu wrote:
>>
>>> This patch adds -static-pie to GCC driver to create static PIE.  A static
>>> position independent executable (PIE) is similar to static executable,
>>> but can be loaded at any address without a dynamic linker.  All linker
>>> input files must be compiled with -fpie or -fPIE and linker must support
>>> --no-dynamic-linker to avoid linking with dynamic linker.  "-z text" is
>>> also needed to prevent dynamic relocations in read-only segments.
>>>
>>> OK for trunk?
>>
>> I think the documentation for various options needs updating to clarify
>> exactly what they mean.  (And potentially help text, which for driver
>> options is in gcc.c:display_help with the common.opt text being ignored in
>> that case.)
>
> Done.
>
>> -static is no longer just "prevents linking with the shared libraries" as
>> the documentation says, given it's also overriding (explicit or
>> configure-time default) -pie.  -pie is no longer just "Produce a position
>> independent executable", it's producing a *dynamically linked* PIE.
>
> Done.
>
>>> +@item -static-pie
>>> +@opindex static-pie
>>> +Produce a static position independent executable on targets that support
>>> +it.  A static position independent executable is similar to static
>>> +executable, but can be loaded at any address without a dynamic linker.
>>
>> "to a static executable".
>>
>
> Done.
>
> Here is the updated patch.   OK for trunk?
>
> Thanks.
>

PING.


-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* PING: [PATCH] Add -static-pie to GCC driver to create static PIE
@ 2017-09-05 15:20 H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2017-09-05 15:20 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GCC Patches

On Mon, Aug 28, 2017 at 10:13 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Aug 28, 2017 at 9:10 AM, Joseph Myers <joseph@codesourcery.com> wrote:
>> On Tue, 8 Aug 2017, H.J. Lu wrote:
>>
>>> This patch adds -static-pie to GCC driver to create static PIE.  A static
>>> position independent executable (PIE) is similar to static executable,
>>> but can be loaded at any address without a dynamic linker.  All linker
>>> input files must be compiled with -fpie or -fPIE and linker must support
>>> --no-dynamic-linker to avoid linking with dynamic linker.  "-z text" is
>>> also needed to prevent dynamic relocations in read-only segments.
>>>
>>> OK for trunk?
>>
>> I think the documentation for various options needs updating to clarify
>> exactly what they mean.  (And potentially help text, which for driver
>> options is in gcc.c:display_help with the common.opt text being ignored in
>> that case.)
>
> Done.
>
>> -static is no longer just "prevents linking with the shared libraries" as
>> the documentation says, given it's also overriding (explicit or
>> configure-time default) -pie.  -pie is no longer just "Produce a position
>> independent executable", it's producing a *dynamically linked* PIE.
>
> Done.
>
>>> +@item -static-pie
>>> +@opindex static-pie
>>> +Produce a static position independent executable on targets that support
>>> +it.  A static position independent executable is similar to static
>>> +executable, but can be loaded at any address without a dynamic linker.
>>
>> "to a static executable".
>>
>
> Done.
>
> Here is the updated patch.   OK for trunk?
>
> Thanks.
>

PING.


-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-07 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-17 13:43 PING: [PATCH] Add -static-pie to GCC driver to create static PIE H.J. Lu
2017-09-05 15:20 H.J. Lu
2017-09-07 15:10 H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).