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

@@ -21,6 +21,14 @@ _start:
# call global constructors
call _init
movl $__init_array_start, %ebx
jmp 2f
1: movl (%ebx), %eax
call *%eax
addl $4, %ebx
2: cmpl $__init_array_end, %ebx
jne 1b
# call main
movl 0(%esp), %eax
xchgl %eax, 8(%esp)