fix(userspace/libc): modify __libc_init and crt0 to initialize "environ"

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-02-22 02:41:41 +02:00
parent 4d333f94bc
commit d7cbeb9eba
3 changed files with 7 additions and 89 deletions

View File

@ -44,10 +44,12 @@ __attribute__((naked, used, no_stack_protector, section(".text"))) void _start()
"andq $-16, %rsp\n"
"movq %rsp, %rbp\n"
"movq %rdx, %rax\n"
"pushq %rcx\n"
"pushq %rdx\n"
"pushq %rsi\n"
"pushq %rdi\n"
"movq %rax, %rdi\n"
"call __libc_init\n"
"call __crt_init_array\n"