Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 16 May 2017 11:02:09 +0200
From: Szabolcs Nagy <>
Subject: Re: Static PIE with musl and clang

* Paul Sturm <> [2017-05-15 14:24:58 -0500]:
> I decided to take a step back and try to make this work first with gcc (7.1) and ld (2.28). Both tools were built statically and musl (1.16+) is also built as a static libc.a. 
> Test program is aslr.c: 
> #include <stdio.h> 
> int main() { 
> printf("%p\n", main); 
> return 0; 
> } 
> gcc aslr.c -fPIE -pie -static-libgcc -Wl,-static -Wl,--no-dynamic-linker 
> ./a.out 
> Segementation fault 

there is no -static passed to the compiler so it cannot possibly
select the right crt file.

you need to patch gcc for static pie support, or pass all the
necessary linker flags manually (including the crt files).

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.