❑ PIE(Position Independent Executable) : An executable file that consists entirely of position-independent code. It is mapped to an arbitrary memory address each time.
* gcc -fPIE -pie -o [Filename of output] [Filename of input]
* -fPIE is the option for Compiler
* -pie is the option for Linker.
❑ Program with PIE
❍ File property : shared object.
❍ Small address code(Relative address).
❍ On x86, there is the function __x86.get_pc_thunk.bx.
* It moves the esp value to ebx to check which address is mapped.
* After the function is terminated, the value of the ebx register is incremented to point to the address of the .got.plt section.
❑ Program without PIE
❍ File property : execuable.
❍ Big address code(Absolute address).