Luna/libc/src/arch/x86_64/crt0.S

24 lines
348 B
ArmAsm

.section .text
.global _start
.extern exit
.extern libc_init
_start:
# Set up end of the stack frame linked list.
movq $0, %rbp
pushq %rbp # rip=0
pushq %rbp # rbp=0
movq %rsp, %rbp
call libc_init
# Run the global constructors.
call _init
# Run main
call main
# Terminate the process with the exit code.
movl %eax, %edi
call exit