This simple hello world:
#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
printf("Hello, world!\n");
return 0;
}
Gives the following assembly in objdump:
/helloworld.c:3 804842c: 83 ec 0c sub $0xc,%esp 804842f: 68 f0 84 04 08 push $0x80484f0 8048434: e8 b7 fe ff ff call 80482f0 8048439: 83 c4 10 add $0x10,%esp /helloworld.c:4 804843c: 83 ec 0c sub $0xc,%esp 804843f: 68 f0 84 04 08 push $0x80484f0 8048444: e8 a7 fe ff ff call 80482f0 8048449: 83 c4 10 add $0x10,%esp
call rel32
instruction: Call near, displacement relative to next instruction
The opcode for this instruction is E8
, followed by the relative offset that is computed by the following equation: destination address - address of next instruction
.
In this case, the relative offset of the first call is 80482f0 - 8048439 = FFFFFEB7
, and the relative offset of the second call is 80482f0 - 8048449 = FFFFFEA7
.