diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-01-30 04:56:37 (GMT) |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2013-01-30 22:32:52 (GMT) |
commit | 025f2b338072781cd747bf7365cf43fcf9f40f1a (patch) | |
tree | f73c10d3ea7bd07539efb731da57c8a2031aee6f /arch/mips/cpu/xburst | |
parent | 67d80c9f97f1b73d227f64efebf204221a611a70 (diff) | |
download | u-boot-025f2b338072781cd747bf7365cf43fcf9f40f1a.tar.xz |
MIPS: simplify relocated _G_O_T_ address calculation
The difference between the address of the original
and the relocated _GLOBAL_OFFSET_TABLE_ is always
the same as the relocation offset.
The relocation offset is already computed and it is
available in the 's1/t6' register. Use that to adjust
the relocated _G_O_T_ address, instead of calculating
the offset again from the _gp value.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
Diffstat (limited to 'arch/mips/cpu/xburst')
-rw-r--r-- | arch/mips/cpu/xburst/start.S | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/mips/cpu/xburst/start.S b/arch/mips/cpu/xburst/start.S index 194d745..9e637df 100644 --- a/arch/mips/cpu/xburst/start.S +++ b/arch/mips/cpu/xburst/start.S @@ -122,7 +122,6 @@ relocate_code: jr t0 nop - .word _gp .word _GLOBAL_OFFSET_TABLE_ .word uboot_end_data .word uboot_end @@ -137,9 +136,7 @@ in_ram: */ lw t3, -4(t0) # t3 <-- num_got_entries lw t4, -16(t0) # t4 <-- _GLOBAL_OFFSET_TABLE_ - lw t5, -20(t0) # t5 <-- _gp - sub t4, t5 # compute offset - add t4, t4, gp # t4 now holds relocated _G_O_T_ + add t4, t6 # t4 now holds relocated _G_O_T_ addi t4, t4, 8 # skipping first two entries li t2, 2 1: |