Adapt to new ___start definition.
Use PIC method to load %r13 with address of _SDA_BASE_
This commit is contained in:
parent
4cbd24b23f
commit
d8b68e8316
@ -29,21 +29,23 @@
|
|||||||
|
|
||||||
#include <powerpc/asm.h>
|
#include <powerpc/asm.h>
|
||||||
|
|
||||||
RCSID("$NetBSD: crt0.S,v 1.1 2011/02/08 02:02:25 matt Exp $")
|
RCSID("$NetBSD: crt0.S,v 1.2 2011/06/30 20:10:17 matt Exp $")
|
||||||
|
|
||||||
STRONG_ALIAS(_start,__start)
|
STRONG_ALIAS(_start,__start)
|
||||||
|
|
||||||
.weak _SDA_BASE_
|
.weak _SDA_BASE_
|
||||||
.weak _SDA_BASE2_
|
|
||||||
|
|
||||||
ENTRY_NOPROFILE(__start)
|
ENTRY_NOPROFILE(__start)
|
||||||
|
bcl 20,31,1f
|
||||||
|
1:
|
||||||
|
mflr %r11
|
||||||
/* SVR4 ABI says small data is in r13 */
|
/* SVR4 ABI says small data is in r13 */
|
||||||
lis %r13,_SDA_BASE_@ha
|
addis %r13,%r11,_SDA_BASE_-1b@ha
|
||||||
addi %r13,%r13,_SDA_BASE_@l
|
addi %r13,%r13,_SDA_BASE_-1b@l
|
||||||
|
|
||||||
/* E[mbedded] ABI says small data is in r2 */
|
mr %r3,%r6
|
||||||
lis %r2,_SDA_BASE2_@ha
|
mr %r4,%r7
|
||||||
addi %r2,%r2,_SDA_BASE2_@l
|
mr %r5,%r8
|
||||||
|
|
||||||
b ___start
|
b ___start
|
||||||
END(__start)
|
END(__start)
|
||||||
|
Loading…
Reference in New Issue
Block a user