summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/crt/sh
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/crt/sh')
-rw-r--r--libc-top-half/musl/crt/sh/crti.s21
-rw-r--r--libc-top-half/musl/crt/sh/crtn.s13
2 files changed, 34 insertions, 0 deletions
diff --git a/libc-top-half/musl/crt/sh/crti.s b/libc-top-half/musl/crt/sh/crti.s
new file mode 100644
index 0000000..d99bfd5
--- /dev/null
+++ b/libc-top-half/musl/crt/sh/crti.s
@@ -0,0 +1,21 @@
+.section .init
+.global _init
+.type _init, @function
+_init:
+ add #-4, r15
+ mov.l r12, @-r15
+ mov.l r14, @-r15
+ sts.l pr, @-r15
+ mov r15, r14
+ nop
+
+.section .fini
+.global _fini
+.type _fini, @function
+_fini:
+ add #-4, r15
+ mov.l r12, @-r15
+ mov.l r14, @-r15
+ sts.l pr, @-r15
+ mov r15, r14
+ nop
diff --git a/libc-top-half/musl/crt/sh/crtn.s b/libc-top-half/musl/crt/sh/crtn.s
new file mode 100644
index 0000000..958ce95
--- /dev/null
+++ b/libc-top-half/musl/crt/sh/crtn.s
@@ -0,0 +1,13 @@
+.section .init
+ lds.l @r15+, pr
+ mov.l @r15+, r14
+ mov.l @r15+, r12
+ rts
+ add #4, r15
+
+.section .fini
+ lds.l @r15+, pr
+ mov.l @r15+, r14
+ mov.l @r15+, r12
+ rts
+ add #4, r15