@@ -96,16 +96,15 @@ int calculate_relocation_address(void)
dest_addr &= ~15;
gd->gdt_addr = dest_addr;
- /* Stack is below GDT */
- gd->start_addr_sp = dest_addr;
-
- /* U-Boot is below the stack */
- dest_addr -= CONFIG_SYS_STACK_SIZE;
+ /* U-Boot is below Global Data */
dest_addr -= (bss_end - text_start);
dest_addr &= ~15;
gd->relocaddr = dest_addr;
gd->reloc_off = (dest_addr - text_start);
+ /* Stack is at the bottom, so it can grow down */
+ gd->start_addr_sp = dest_addr - CONFIG_SYS_MALLOC_LEN;
+
return 0;
}