summaryrefslogtreecommitdiff
path: root/src/nonstd/x86-64.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/nonstd/x86-64.s')
-rw-r--r--src/nonstd/x86-64.s19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nonstd/x86-64.s b/src/nonstd/x86-64.s
new file mode 100644
index 00000000..60aba7a1
--- /dev/null
+++ b/src/nonstd/x86-64.s
@@ -0,0 +1,19 @@
+.global __syscall
+__syscall:
+ mov %rdi, %rax
+ mov %rsi, %rdi
+ mov %rdx, %rsi
+ mov %rcx, %rdx
+ mov %r8, %r10
+ mov %r9, %r8
+ mov 8(%rsp), %r9
+ syscall
+ ret
+
+/* FIXME: this seems to be unpossible to put in a shared library */
+/* FIXME: it may be worthwhile to separate this into crt1.s */
+.global _start
+_start:
+ popq %rdi
+ movq %rsp, %rsi
+ call __libc_start