From c77b0fa7916f79c099ee4a6a80a093334e9090ac Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 27 Jul 2022 13:59:52 +0200 Subject: user/libc: execve() supports passing argv now --- src/user/lib/crt0.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/user/lib/crt0.s (limited to 'src/user/lib/crt0.s') diff --git a/src/user/lib/crt0.s b/src/user/lib/crt0.s new file mode 100644 index 0000000..dd9ab1b --- /dev/null +++ b/src/user/lib/crt0.s @@ -0,0 +1,18 @@ +.section .text +.global _start +.type _start, @function +.weak _start +_start: + mov %rsp, %rbp + and $~0xF, %rsp + call elf_selfreloc + + mov %rbp, %rsp + /* pushed by _freejmp */ + pop %rdi + pop %rsi + pop %rdx + and $~0xF, %rsp + call main + mov %rax, %rdi + jmp exit -- cgit v1.2.3