mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 13:59:29 +02:00
Correct passing envp to main
git-svn-id: trunk@20288 -
This commit is contained in:
parent
6cd1c2a60c
commit
d9249ab44d
@ -63,6 +63,7 @@ __start:
|
||||
pushl %ecx
|
||||
pushl %edx
|
||||
pushl %eax
|
||||
movl %ecx,operatingsystem_parameter_envp
|
||||
movl %eax,operatingsystem_parameter_argc
|
||||
movl %edx,operatingsystem_parameter_argv
|
||||
call ___start
|
||||
@ -87,7 +88,6 @@ ___start:
|
||||
movl 28(%ebp),%edi
|
||||
movl environ@GOT(%ebx),%eax
|
||||
movl %edx,(%eax)
|
||||
movl %edx,operatingsystem_parameter_envp
|
||||
movl __progname@GOT(%ebx),%edx
|
||||
movl (%esi),%eax
|
||||
movl %eax,(%edx)
|
||||
@ -140,6 +140,7 @@ ___start:
|
||||
|
||||
// xorl %ebp,%ebp /* Detect main from nested */
|
||||
/* procs/unwinding? */
|
||||
movl operatingsystem_parameter_envp, %eax
|
||||
pushl (%eax)
|
||||
pushl (%esi)
|
||||
pushl 8(%ebp)
|
||||
@ -420,6 +421,9 @@ _dladdr:
|
||||
.Lfe8:
|
||||
.size _dladdr,.Lfe8-_dladdr
|
||||
.comm environ,4,4
|
||||
.comm operatingsystem_parameter_envp,4,4
|
||||
.comm operatingsystem_parameter_argc,4,4
|
||||
.comm operatingsystem_parameter_argv,4,4
|
||||
.comm __mainprog_obj,4,4
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user