Created
May 25, 2017 12:39
-
-
Save rhizoome/92b8267670f5909b4bf36664b030c123 to your computer and use it in GitHub Desktop.
My new favourite pie and musl static binaries are sooooooo small!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> cat static-pie.c | |
#include <stdio.h> | |
int main(void) { | |
printf("%p\n", main); | |
} | |
$> gcc -static static-pie.c | |
$> ./a.out | |
0x7422f6eb35c5 | |
$> ./a.out | |
0x76d64a08b5c5 | |
$> gcc -fpie -static static-pie.c | |
$> ./a.out | |
0x6c23374a85c5 | |
$> ./a.out | |
0x77d7948d15c5 | |
$> strip -S a.out | |
$> ls -lh a.out | |
-rwxr-xr-x 1 ganwell ganwell 22.7K May 25 14:38 a.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment