Hello, I have written a simple Hello World program.
I wanted to understand how the relocatable object file and executable file look like. The object file corresponding to the main function is
Here the function call for printf is callq 13. One thing i don't understand is why is it 13. That means call the function at adresss 13, right??. 13 has the next instruction, right?? Please explain me what does this mean??
The executable code corresponding to main is
Here it is callq 4003c0. But the binary instruction is e8 e1 fe ff ff. There is nothing that corresponds to 4003c0. What is that i am getting wrong?
Take a look at this line:
You see a calculation of the address of main, plus the hex value 0x13, an offset.
If you take your main-address of the second code example (4004cc) and add the offset (0x13), you get 4004df, which corresponds to the same instruction as the one in your first example.
answered 09 May '10, 20:20