分类: LINUX
2008-07-30 15:06:16
mips_fp_be-objdump -D u-boot |
|
“bal 1f” load the the address of _GLOBAL_OFFSET_TABLE_ into ra.
“lw t1, 0(ra)” load the destination register (ra) with the contents of the word that is at the memory location.
Finally, GOT header is saved into gp.
Use assemble code, the following sentence can get the address.
la t9, lowlevel_init
But in final code, to get the location-independent address, u-boot adds the gp and an offset to get the address.
bfc00458: 8f9902b0 lw t9,688(gp)
Please refer to the GOT table, start at “bfc34500 <_GLOBAL_OFFSET_TABLE_>”.
The address of GOT is 0xbfc34500, the offset is 688 (0x2b0), the result is 0xbfc347b0. The content of address 0xbfc347b0 is 0xbfc07a70. And the address 0xbfc07a70 just is the address of lowlevel_init.
The address of mips_cache_reset is:
0xbfc0fa90 = 0xbfc34500 + 0x4ec.