summaryrefslogtreecommitdiff
path: root/src/user/lib/crt0.s
blob: 3548264b0ff29781eee1add576e9bb2c1b1e295a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.section .text
.global _start
.type _start, @function
.weak _start
_start:
	mov %rsp, %rbp
	and $~0xF, %rsp
	call elf_selfreloc

	mov %rbp, %rsp

	pop %rdi
	call __setinitialcwd

	pop %rdi
	pop %rsi
	pop %rdx
	and $~0xF, %rsp
	call main
	mov %rax, %rdi
	jmp exit