PIE

Position-Independent Executable (PIE)

  • A normal ELF executable (non-PIE) will have a fixed load address, and the type ET_EXEC

readelf -h non_PIE_bin
Type:    EXEC ...
  • A PIE executable behaves like shared libraries such that they must be position-independent

    • this means that all code uses RIP-relative addressing

readelf -h PIE_bin
Type:    DYN (Position-Independent Executable file)

Disable randomization

Specifies whether GDB should disable the address space randomization provided by Linux kernel before starting the debugged program.

gdb> set disable-randomization on
gdb> set disable-randomization off
gdb> show disable-randomization

Last updated