summaryrefslogtreecommitdiff
path: root/lib/entry_x86_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/entry_x86_64.S')
-rw-r--r--lib/entry_x86_64.S18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/entry_x86_64.S b/lib/entry_x86_64.S
new file mode 100644
index 0000000..231953a
--- /dev/null
+++ b/lib/entry_x86_64.S
@@ -0,0 +1,18 @@
+.section .text.start
+.extern kc_reloc
+.extern kc_main
+.extern _DYNAMIC
+.extern kc_image_base
+
+.global kc_entry
+.type kc_entry, @function
+kc_entry:
+ push %rdi
+ lea _DYNAMIC(%rip), %rdi
+ lea kc_image_base(%rip), %rsi
+ call kc_reloc
+ pop %rdi
+ call kc_main
+ ret
+.size kc_entry, . - kc_entry
+