summaryrefslogtreecommitdiff
path: root/src/user/lib/crt0.s
blob: dd9ab1bf61360c6c2bbefcc5dd5ca29a4c64155e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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