Kernel/LibC: Add support for init_array and fini_array

This commit is contained in:
2024-08-26 14:04:58 +03:00
parent 7c4b9218f2
commit 2c520391eb
18 changed files with 154 additions and 51 deletions

View File

@@ -22,6 +22,14 @@ _start:
# call global constructors
call _init
movq $__init_array_start, %rbx
jmp 2f
1: movq (%rbx), %rax
call *%rax
addq $8, %rbx
2: cmpq $__init_array_end, %rbx
jne 1b
# call main
movq 16(%rsp), %rdi
movq 8(%rsp), %rsi