details of address relocation procedure
Eric Fisher
joefoxreal@gmail.com
Mon Mar 20 09:58:00 GMT 2006
>As both call foo and call foo2 are represented by "e8 fc ff ff ff ",
how can the linker
>tell them apart and `backpatch' correctly? a related question is:
does opcode fc ff
>ff ff (following e8) means "address to be solved"? does opcode 00 00 00 00
>(following ff 05) means variable address to be solved"?
10: ff 05 00 00 00 00 incl 0x0
"ff 05 00 00 00 00" is the binary code of instruction 'incl 0x0',
which corresponds to
"bar++;"
16: e8 fc ff ff ff call 17 <main+0x17>
1b: e8 fc ff ff ff call 1c <main+0x1c>
These correspond to "foo(); foo2();". The called function
address are of relocation address with the specified relocation type.
You can use 'objdump -r' to
learn this. Because the linker hasn't relocate the correct address to
them, so the
binary code of them are the same for now. BFD tells more about this.
Eric.
More information about the Binutils
mailing list