aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/crt-arm-Scrt1.s
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/crt-arm-Scrt1.s')
-rw-r--r--main/musl/crt-arm-Scrt1.s34
1 files changed, 34 insertions, 0 deletions
diff --git a/main/musl/crt-arm-Scrt1.s b/main/musl/crt-arm-Scrt1.s
new file mode 100644
index 0000000000..b8fdfda995
--- /dev/null
+++ b/main/musl/crt-arm-Scrt1.s
@@ -0,0 +1,34 @@
+.weak _init
+.weak _fini
+.text
+.global _start
+_start:
+ mov fp,#0
+ mov lr,#0
+
+ pop { a2 }
+ mov a3, sp
+ push { a3 }
+ push { a1 }
+
+ ldr sl, .L_GOT
+ adr a4, .L_GOT
+ add sl, sl, a4
+ ldr ip, .L_GOT+4
+ ldr ip, [sl, ip]
+ push { ip }
+ ldr a4, .L_GOT+8
+ ldr a4, [sl, a4]
+ ldr a1, .L_GOT+12
+ ldr a1, [sl, a1]
+
+ bl __libc_start_main(PLT)
+1: b 1b
+
+ .align 2
+.L_GOT:
+ .word _GLOBAL_OFFSET_TABLE_ - .L_GOT
+ .word _fini(GOT)
+ .word _init(GOT)
+ .word main(GOT)
+