summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-11-01 22:54:31 +0100
committerWolfgang Denk <wd@denx.de>2007-11-01 22:54:31 +0100
commit2fa0dd158c0a3faa6e481169c097e8d7fe662581 (patch)
tree4b0545515cd62e1d48c368db95765efed0a178a5 /cpu
parent0f8b8d0f4c1579a55aaebd1974517552766ab7e5 (diff)
parentde9a738faa7c2f47286119c3bfebc3dfbfe7d86d (diff)
Merge branch 'master' of git://www.denx.de/git/u-boot-mips
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mips/config.mk2
-rw-r--r--cpu/mips/start.S19
2 files changed, 14 insertions, 7 deletions
diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
index b29986e26b7..487c4eb5d64 100644
--- a/cpu/mips/config.mk
+++ b/cpu/mips/config.mk
@@ -35,6 +35,6 @@ else
ENDIANNESS = -EB
endif
-MIPSFLAGS += $(ENDIANNESS) -mabicalls
+MIPSFLAGS += $(ENDIANNESS)
PLATFORM_CPPFLAGS += $(MIPSFLAGS)
diff --git a/cpu/mips/start.S b/cpu/mips/start.S
index e91e2137d70..074d01d2dde 100644
--- a/cpu/mips/start.S
+++ b/cpu/mips/start.S
@@ -234,11 +234,11 @@ reset:
li t0, CONF_CM_UNCACHED
mtc0 t0, CP0_CONFIG
- /* Initialize GOT pointer.
+ /* Initialize $gp.
*/
bal 1f
nop
- .word _GLOBAL_OFFSET_TABLE_
+ .word _gp
1:
move gp, ra
lw t1, 0(ra)
@@ -306,9 +306,9 @@ relocate_code:
move t1, a2
/*
- * Fix GOT pointer:
+ * Fix $gp:
*
- * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) + Destination Address
+ * New $gp = (Old $gp - CFG_MONITOR_BASE) + Destination Address
*/
move t6, gp
sub gp, CFG_MONITOR_BASE
@@ -341,15 +341,22 @@ relocate_code:
j t0
nop
+ .gpword _GLOBAL_OFFSET_TABLE_ /* _GLOBAL_OFFSET_TABLE_ - _gp */
.word uboot_end_data
.word uboot_end
.word num_got_entries
in_ram:
- /* Now we want to update GOT.
+ /*
+ * Now we want to update GOT.
+ *
+ * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
+ * generated by GNU ld. Skip these reserved entries from relocation.
*/
lw t3, -4(t0) /* t3 <-- num_got_entries */
- addi t4, gp, 8 /* Skipping first two entries. */
+ lw t4, -16(t0) /* t4 <-- (_GLOBAL_OFFSET_TABLE_ - _gp) */
+ add t4, t4, gp /* t4 now holds _GLOBAL_OFFSET_TABLE_ */
+ addi t4, t4, 8 /* Skipping first two entries. */
li t2, 2
1:
lw t1, 0(t4)