mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
* call finalization routine of dynamic linker before exiting (forgot to
commit earlier) git-svn-id: trunk@10663 -
This commit is contained in:
parent
18e663240a
commit
7901625134
@ -40,6 +40,9 @@ procedure PASCALMAIN; external name 'PASCALMAIN';
|
||||
******************************************************************************}
|
||||
{$asmmode ATT}
|
||||
|
||||
var
|
||||
dlexitproc: pointer;
|
||||
|
||||
procedure _FPC_proc_start; assembler; nostackframe; public name '_start';
|
||||
asm
|
||||
{ First locate the start of the environment variables }
|
||||
@ -52,6 +55,8 @@ asm
|
||||
movl %ecx,operatingsystem_parameter_argc
|
||||
movl %ebx,operatingsystem_parameter_argv
|
||||
|
||||
movl %edx, dlexitproc
|
||||
|
||||
fninit { initialize fpu }
|
||||
fwait
|
||||
fldcw Default8087CW
|
||||
@ -70,6 +75,11 @@ end;
|
||||
procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc';
|
||||
asm
|
||||
.Lhaltproc:
|
||||
movl dlexitproc,%eax
|
||||
testl %eax,%eax
|
||||
je .Lnodlexitproc
|
||||
call *%eax
|
||||
.Lnodlexitproc:
|
||||
movl syscall_nr_exit_group,%eax
|
||||
{$if sizeof(ExitCode)=2}
|
||||
movzwl ExitCode,%ebx
|
||||
|
Loading…
Reference in New Issue
Block a user