PING: [PATCH] Add --enable-static-pie to build static PIE
H.J. Lu
hjl.tools@gmail.com
Thu Sep 28 12:26:00 GMT 2017
On 9/28/17, Markus Trippelsdorf <markus@trippelsdorf.de> wrote:
> On 2017.09.27 at 01:30 -0700, H.J. Lu wrote:
>> No separate PIE copy of libc.a, is used for static PIE to minimize
>> GCC driver change. To improve system security, glibc can be built with
>> --enable-static-pie, and the same libc.a can be used to build both static
>> executable and static PIE.
>
> It doesn't work:
>
> ~ % echo "int main(){}" | gcc -x c - -static
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../lib64/libc.a(dl-support.o):
> In function `elf_machine_load_address':
> /home/markus/glibc/elf/../sysdeps/x86_64/dl-machine.h:59: undefined
> reference to `_DYNAMIC'
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../lib64/libc.a(dl-support.o):
> In function `elf_get_dynamic_info':
> /home/markus/glibc/elf/get-dynamic-info.h:48: undefined reference to
> `_DYNAMIC'
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../x86_64-pc-linux-gnu/bin/ld:
> a.out: hidden symbol `_DYNAMIC' isn't defined
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/../../../../x86_64-pc-linux-gnu/bin/ld:
> final link failed: Bad value
> collect2: error: ld returned 1 exit status
>
Thanks for your test. Fixed on hjl/pie/static branch. I am
enclosing the updated
--enable-static-pie patch.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-enable-static-pie-configure-option-to-build-stat.patch
Type: text/x-patch
Size: 24392 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170928/5b561b1f/attachment.bin>
More information about the Libc-alpha
mailing list