Search code examples
gccposition-independent-code

Why address of code segment is zero?


After I updated my kali linux, then I use gcc to compile my program. Before I updated the system, I used objdump to disassembly the program, the .text address is from 0x08048..., but after that, the .text address is from 0x00000..., the gcc version was changed from 6.1.1 to 6.3, what's wrong? Why does this happen?


Solution

  • I believe that's because new version builds executables with -fPIE by default (prooflink). Position-independency should theoretically improve security of the system.