2 * Copyright (C) Paul Mackerras 1997.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * NOTE: this code runs in 32 bit mode and is packaged as ELF32.
15 /* a procedure descriptor used when booting this as a COFF file */
16 .globl _zimage_start_opd
18 .long _zimage_start, 0, 0, 0
23 .globl _zimage_start_lib
25 /* Work out the offset between the address we were linked at
26 and the address where we're running. */
32 beq 3f /* if running at same address as linked */
34 /* The .got2 section contains a list of addresses, so add
35 the address offset onto each entry. */
36 lis r9,__got2_start@ha
37 addi r9,r9,__got2_start@l
39 addi r8,r8,__got2_end@l
51 /* Do a cache flush for our text, in case the loader didn't */
68 addi r9,r9,__bss_start@l
79 /* Possibly set up a custom stack */
80 .weak _platform_stack_top
81 lis r8,_platform_stack_top@ha
82 addi r8,r8,_platform_stack_top@l
89 stwu r0,-16(r1) /* establish a stack frame */
92 /* Call platform_init() */