summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/x86_64/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/arch/x86_64/crt0.S')
-rw-r--r--usr/klibc/arch/x86_64/crt0.S22
1 files changed, 22 insertions, 0 deletions
diff --git a/usr/klibc/arch/x86_64/crt0.S b/usr/klibc/arch/x86_64/crt0.S
new file mode 100644
index 0000000..6a5f335
--- /dev/null
+++ b/usr/klibc/arch/x86_64/crt0.S
@@ -0,0 +1,22 @@
+#
+# arch/x86_64/crt0.S
+#
+# Does arch-specific initialization and invokes __libc_init
+# with the appropriate arguments.
+#
+# See __static_init.c or __shared_init.c for the expected
+# arguments.
+#
+
+ .text
+ .align 4
+ .type _start,@function
+ .globl _start
+_start:
+ movq %rsp,%rdi # Offset of the ELF data structure
+ movq %rdx,%rsi # The atexit() pointer (if any)
+ call __libc_init
+ # We should never get here...
+ hlt
+
+ .size _start,.-_start