
On Thu, 2008-06-05 at 09:50 +0800, wang baohua wrote:
Dear Johansson, Thanks for your reply. Your reply is very clear, that's just my question. In fact, I am study a MIPS binary file, but I cannot find any resource, so I turn to PowerPC platform and try to get clear understand about the string loading process.
I'm not sure how similar MIPS is to ppc ABI.
I want to ask according to your reply:
- fff0358c: 80 7e 80 00 lwz r3,-32768(r30) Is the -32768 stand for " entry 0 in the .got table" ? Why such a
translate in objdump?
It's not objectdump that do this it's the compiler that generate the code like this. r30 is a pointer to the GOT table but the pointer is located so that it's possible to use the full range of the 16 bit signed offset. that is if the GOT table only have one entry the r30 value would be pointing outside of the table but since it's accessed with a singed offset it will still work.
- I found the .got2 section in the U-boot.map, can you tell me how to
calc the right string address (traps.o) ? .reloc 0xfff34000 0x1578 *(.got) 0xfff34000 _GOT2_TABLE_ = . *(.got2) .got2 0xfff34000 0x24 cpu/mpc8260/start.o .got2 0xfff34024 0x4c cpu/mpc8260/libmpc8260.a(traps.o)
?? I thought this was obvious. to get the entry from the code take the offset value used in the load and subtract -32768 to get the offset into the .got2 section. at that address will be a 32 bit address that is the address of the string.
thanks!