ciabatta/arch/x86-64/loader-entry.asm

19 lines
339 B
NASM
Raw Normal View History

2023-08-02 03:43:07 +00:00
bits 64
section .text
default rel
global _dlstart
2023-08-03 13:16:15 +00:00
extern _DYNAMIC:weak
2023-08-02 03:43:07 +00:00
_dlstart:
xor rbp, rbp
mov rdi, rsp
2023-08-03 13:16:15 +00:00
lea rsi, _DYNAMIC
and rsp, -16
2023-08-05 11:20:20 +00:00
; `call` pushes 8-byte value onto the stack
; by pushing an 8-bit value ourselves we can make
; sure the stack is aligned after rbp push in prologue
sub rsp, 8