1c1
< /* $FreeBSD: head/sys/powerpc/aim/locore32.S 278495 2015-02-10 06:35:16Z rpaulo $ */
---
> /* $FreeBSD: head/sys/powerpc/aim/locore32.S 279750 2015-03-07 20:14:46Z nwhitehorn $ */
111,120c111,116
< li 8,0
< li 9,0x100
< mtctr 9
< 1:
< dcbf 0,8
< icbi 0,8
< addi 8,8,0x20
< bdnz 1b
< sync
< isync
---
> /* Figure out where we are */
> bl 1f
> .long _DYNAMIC-.
> .long _GLOBAL_OFFSET_TABLE_-.
> .long tmpstk-.
> 1: mflr %r30
122,131c118,135
< /* Zero bss, in case we were started by something unhelpful */
< li 0,0
< lis 8,_edata@ha
< addi 8,8,_edata@l
< lis 9,_end@ha
< addi 9,9,_end@l
< 2: stw 0,0(8)
< addi 8,8,4
< cmplw 8,9
< blt 2b
---
> /* Set up temporary stack pointer */
> lwz %r1,8(%r30)
> add %r1,%r1,%r30
> addi %r1,%r1,(8+TMPSTKSZ-32)
>
> /* Relocate self */
> stw %r3,16(%r1)
> stw %r4,20(%r1)
> stw %r5,24(%r1)
> stw %r6,28(%r1)
>
> lwz %r3,0(%r30) /* _DYNAMIC in %r3 */
> add %r3,%r3,%r30
> lwz %r4,4(%r30) /* GOT pointer */
> add %r4,%r4,%r30
> lwz %r4,4(%r4) /* got[0] is _DYNAMIC link addr */
> subf %r4,%r4,%r3 /* subtract to calculate relocbase */
> bl elf_reloc_self
133,134c137,140
< lis 1,(tmpstk+TMPSTKSZ-16)@ha
< addi 1,1,(tmpstk+TMPSTKSZ-16)@l
---
> lwz %r3,16(%r1)
> lwz %r4,20(%r1)
> lwz %r5,24(%r1)
> lwz %r6,28(%r1)
135a142
> /* MD setup */
136a144,145
>
> /* Set stack pointer to new value and branch to mi_startup */
140a150,151
>
> /* If mi_startup somehow returns, exit. This would be bad. */
< /* $FreeBSD: head/sys/powerpc/aim/locore32.S 278495 2015-02-10 06:35:16Z rpaulo $ */
---
> /* $FreeBSD: head/sys/powerpc/aim/locore32.S 279750 2015-03-07 20:14:46Z nwhitehorn $ */
111,120c111,116
< li 8,0
< li 9,0x100
< mtctr 9
< 1:
< dcbf 0,8
< icbi 0,8
< addi 8,8,0x20
< bdnz 1b
< sync
< isync
---
> /* Figure out where we are */
> bl 1f
> .long _DYNAMIC-.
> .long _GLOBAL_OFFSET_TABLE_-.
> .long tmpstk-.
> 1: mflr %r30
122,131c118,135
< /* Zero bss, in case we were started by something unhelpful */
< li 0,0
< lis 8,_edata@ha
< addi 8,8,_edata@l
< lis 9,_end@ha
< addi 9,9,_end@l
< 2: stw 0,0(8)
< addi 8,8,4
< cmplw 8,9
< blt 2b
---
> /* Set up temporary stack pointer */
> lwz %r1,8(%r30)
> add %r1,%r1,%r30
> addi %r1,%r1,(8+TMPSTKSZ-32)
>
> /* Relocate self */
> stw %r3,16(%r1)
> stw %r4,20(%r1)
> stw %r5,24(%r1)
> stw %r6,28(%r1)
>
> lwz %r3,0(%r30) /* _DYNAMIC in %r3 */
> add %r3,%r3,%r30
> lwz %r4,4(%r30) /* GOT pointer */
> add %r4,%r4,%r30
> lwz %r4,4(%r4) /* got[0] is _DYNAMIC link addr */
> subf %r4,%r4,%r3 /* subtract to calculate relocbase */
> bl elf_reloc_self
133,134c137,140
< lis 1,(tmpstk+TMPSTKSZ-16)@ha
< addi 1,1,(tmpstk+TMPSTKSZ-16)@l
---
> lwz %r3,16(%r1)
> lwz %r4,20(%r1)
> lwz %r5,24(%r1)
> lwz %r6,28(%r1)
135a142
> /* MD setup */
136a144,145
>
> /* Set stack pointer to new value and branch to mi_startup */
140a150,151
>
> /* If mi_startup somehow returns, exit. This would be bad. */