This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add -static-pie to GCC driver to create static PIE
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 9 Aug 2017 03:39:07 -0700
- Subject: Re: [PATCH] Add -static-pie to GCC driver to create static PIE
- Authentication-results: sourceware.org; auth=none
- References: <20170808221841.GA16793@gmail.com> <40D6B383-67B4-4963-B01A-D08050B316CA@gmail.com>
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.
--
H.J.