summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/ppc64/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/arch/ppc64/crt0.S')
-rw-r--r--usr/klibc/arch/ppc64/crt0.S43
1 files changed, 43 insertions, 0 deletions
diff --git a/usr/klibc/arch/ppc64/crt0.S b/usr/klibc/arch/ppc64/crt0.S
new file mode 100644
index 0000000..ed14534
--- /dev/null
+++ b/usr/klibc/arch/ppc64/crt0.S
@@ -0,0 +1,43 @@
+#
+# arch/ppc64/crt0.S
+#
+# void _start(void)
+# {
+# /* Divine up argc, argv, and envp */
+# environ = envp;
+# exit(main(argc, argv, envp));
+# }
+#
+
+ .text
+ .balign 4
+ .globl _start
+#if _CALL_ELF == 2
+ .type _start,@function
+_start:
+#else
+ .section ".opd","aw"
+ .balign 8
+_start:
+ .quad ._start, .TOC.@tocbase, 0
+ .previous
+ .type ._start,@function
+._start:
+#endif
+
+#if _CALL_ELF == 2
+0: addis 2,12,.TOC.-0b@ha
+ addi 2,2,.TOC.-0b@l
+#endif
+
+ stdu %r1,-32(%r1)
+ addi %r3,%r1,32
+ li %r4,0 /* fini (unused) */
+ b __libc_init
+ nop
+
+#if _CALL_ELF == 2
+ .size _start,.-_start
+#else
+ .size _start,.-._start
+#endif