#include <stdio.h>
int main() {
printf("text at %p\n", main);
int c = getchar();
}
Compiling the above code on VirtualBox Ubuntu 64 bit and running it, I get:
text at 0x55555555468a
pmap:
0000555555554000 4K r-x-- a.out
However,
objdump -dj .text a.out | sed -n '/:/,/^$/p':
000000000000068a :
68a: 55 push %rbp
gdb a.out
Dump of assembler code for function main:
0x000000000000068a <+0>: push %rbp
Entirely different addresses for linked code ?