From: Olaf Hering <olh@suse.de>
Subject: [klibc] [PATCH] update crt0.S on ppc32
The _start stuff was changed some time ago, but ppc was not updated.
This fixes klibc for me. I'm not sure what to do with the second arg to
__libc_init, so I set it to 0..
However, looking at other static binaries, there is more stuff todo.
diff --git a/klibc/arch/ppc/crt0.S b/klibc/arch/ppc/crt0.S
index f7274b0..861c8e7 100644
--- a/klibc/arch/ppc/crt0.S
+++ b/klibc/arch/ppc/crt0.S
@@ -1,29 +1,14 @@
#
# arch/ppc/crt0.S
#
-# void _start(void)
-# {
-# /* Divine up argc, argv, and envp */
-# environ = envp;
-# exit(main(argc, argv, envp));
-# }
-#
.text
.align 4
.type _start,@function
.globl _start
_start:
- lwz 3,0(1)
- addi 4,1,4
- addi 5,1,8
- slwi 0,3,2
- add 5,5,0
- li 0,0
- stwu 0,-16(1)
- lis 9,environ@ha
- stw 5,environ@l(9)
- bl main
- bl exit
+ mr 3,1
+ li 4,0
+ bl __libc_init
.size _start,.-_start