This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: details of address relocation procedure


>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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]