aboutsummaryrefslogtreecommitdiff
path: root/sys/rt/amd64/crti.s
blob: eeba8b1dd3a333736db6b075a3b6795be31cd453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
global _init
global _fini

section .init
_init:
    ; call pushes an 8 byte return address on the stack
    ; 64 bit ABI requires stack to be aligned to 16 bytes
    ; we realign with another 8 byte address
    push rbp
    mov  rbp, rsp
    ;; compiler inserts the rest here

section .fini
_fini:
    push rbp ; see above
    mov  rbp, rsp
    ;; compiler inserts the rest here