Provide envp to the main function.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-02-16 16:06:30 +01:00
parent b8f85d9ef2
commit d3b9bdb3ba
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -37,6 +37,7 @@ _start:
movl %ecx, environ # envp
# Arguments for main
push %ecx # envp
push %ebx # argv
push %eax # argc