Compile without ASLR protections
ASLR is a kernel feature but it’s Linux implementation on x86 is tied to the application being compiled as a Prosition Independent Executable (PIE). non-PIE ASLR applications are mapped to a constant address.
PIE is a precondition to enable address space layout randomization (ASLR).
By default gcc compiles with PIE, if you want to disable it use:
-no-pie
Overhead for -fPIE
in -O2
and -O3
:
Source: https://nebelwelt.net/publications/files/13PPREW.pdf 2.3.