Provide envp to the main function.
This commit is contained in:
parent
b8f85d9ef2
commit
d3b9bdb3ba
|
@ -39,12 +39,14 @@ _start:
|
|||
# Prepare signals, memory allocation, stdio and such.
|
||||
pushq %rsi
|
||||
pushq %rdi
|
||||
pushq %rcx
|
||||
call initialize_standard_library
|
||||
|
||||
# Run the global constructors.
|
||||
call _init
|
||||
|
||||
# Run main
|
||||
popq %rdx # Note! envp is now %rdx (previously %rcx)
|
||||
popq %rdi
|
||||
popq %rsi
|
||||
call main
|
||||
|
|
|
@ -37,6 +37,7 @@ _start:
|
|||
movl %ecx, environ # envp
|
||||
|
||||
# Arguments for main
|
||||
push %ecx # envp
|
||||
push %ebx # argv
|
||||
push %eax # argc
|
||||
|
||||
|
|
Loading…
Reference in New Issue