21 May 2012 22:54
[PATCH] compile as PIE by default
Reimar Döffinger <Reimar.Doeffinger <at> gmx.de>
2012-05-21 20:54:15 GMT
2012-05-21 20:54:15 GMT
Hello, below patch would compile MPlayer as PIE on x86 by default. On 32 bit, the cost would only be in a larger binary size and having to do relocations at startup, but no real cost at runtime. On 64 bit, there is almost no size or runtime overhead, mostly that in some cases PIC-relative addressing has to be used. I believe that none of the assembler code will be disabled by either. I have not made any changes to other architectures since I can't judge the impact. A side effect of the 64 bit case is that MPlayer will refuse to link against some static libraries (those not compiled with PIC and thus violating the ABI), one example (which only exists as static library) is LIVE555 as provided by Debian. Another point is that backtraces without debug info will probably be even less useful. Any comments? My belief is that there is negligible if any disadvantage for a sometimes significant win in security. Index: configure =================================================================== --- configure (revision 34955) +++ configure (working copy) <at> <at> -2643,6 +2643,22 <at> <at> fi +# try to create a relocatable binary by default +echocheck "relocatable binary" +if x86_32 && cflag_check -pie ; then + extra_ldflags="$extra_ldflags -pie"(Continue reading)
RSS Feed