
22 Nov
2015
22 Nov
'15
7:51 p.m.
Hello,
MIPS relocate_code function changes the global offset register (gp) with relocation offset.
(from arch/mips/cpu/start.S)
221 PTR_ADD gp, s1 # adjust gp
But further in same function C function 'flush_cache' is called. This function modifies gp, so the earlier modification to gp is undone. Furthermore, 'in_ram' is called from 'relocate_code'. In 'in_ram', there are references to gp
306 PTR_LA t1, __bss_start # t1 <-- __bss_start 307 PTR_LA t2, __bss_end # t2 <-- __bss_end 316 PTR_LA t9, board_init_r
Because of gp modification by 'flush_cache', these will give older address (before relocation).
Shouldn't these result in relocated addresses?
Thanks Kaushal