3 ms·
Gcc these days compiles with -pie (Position Independent Executable) by default. This makes the text section position independent and able to be relocated, like
by archgoon 6y ago
Gcc these days compiles with -pie (Position Independent Executable) by default. This makes the text section position independent and able to be relocated, like a shared library.
You are correct that the main TEXT section used to typically not be position independent.
- saagarjha 6y agoNot only is the text segment relocatable, the entire binary is generally compiled as ET_DYN so it is a shared library in a sense.