I have compiled a simple hello world c code with gcc -fpie test.c
, and now looking at the binary using objdump
:
Disassembly of section __TEXT,__text:
__text:
100000f40: 55 pushq %rbp
100000f41: 48 89 e5 movq %rsp, %rbp
100000f44: 48 83 ec 10 subq $16, %rsp
100000f48: 89 7d fc movl %edi, -4(%rbp)
100000f4b: 8b 75 fc movl -4(%rbp), %esi
100000f4e: 48 8d 3d 5d 00 00 00 leaq 93(%rip), %rdi
100000f55: b0 00 movb $0, %al
...
Are these virtual (runtime) addresses considering I have compiled with -fpie
? what are they used for if code is position independent.
If I remove the fpie
I do get the same addresses on the left, and I'm assuming they are virtual addresses where these instructions will be loaded to correct?