Hacker News new | ask | show | jobs
by archgoon 2154 days 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.

1 comments

Not only is the text segment relocatable, the entire binary is generally compiled as ET_DYN so it is a shared library in a sense.