3 # This file
is part of the Free Pascal run time library
.
4 # Copyright
(c
) 1999-2000 by Michael Van Canneyt and Peter Vreman
5 # members of the Free Pascal development team
.
7 # See the file COPYING
.FPC
, included
in this distribution
,
8 # for details about the copyright
.
10 # This program
is distributed
in the hope that it will be useful
,
11 # but WITHOUT ANY WARRANTY
;without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
.
14 #**********************************************************************}
16 # Linux ELF startup code
for Free Pascal
22 .type _start
,@function
24 /* First locate the start of the environment variables */
28 movl
%esp
,%ebx
/* Points to the arguments */
33 andl
$0xfffffff8,%esp
/* Align stack */
35 movl
%eax
,U_SYSLINUX_ENVP
/* Move the environment pointer */
36 movl
%esi
,U_SYSLINUX_ARGC
/* Move the argument counter */
37 movl
%ebx
,U_SYSLINUX_ARGV
/* Move the argument pointer */
49 call __libc_start_main
52 /* fake main routine which will be run from libc */
56 /* save return address */
59 movl
%ebx
,___fpc_ret_ebx
60 movl
%esi
,___fpc_ret_esi
61 movl
%edi
,___fpc_ret_edi
64 /* start the program */
68 .type _haltproc
,@function
70 xorl
%eax
,%eax
/* load and save exitcode */
71 movw U_SYSLINUX_EXITCODE
,%ax
73 movl ___fpc_ret
,%edx
/* return to libc */
74 movl ___fpc_ret_ebx
,%ebx
75 movl ___fpc_ret_esi
,%esi
76 movl ___fpc_ret_edi
,%edi
81 .type __gmon_start__
,@object
84 movl __monstarted
,%eax
87 movl
%edx
,__monstarted
90 pushl
$etext
/* Initialize gmon */
105 .globl ___fpc_brk_addr
/* heap management */
106 .type ___fpc_brk_addr
,@object
107 .size ___fpc_brk_addr
,4
111 ___fpc_ret
: /* return address to libc */
121 .lcomm __monstarted
,4
125 # Revision
1.1 2002/02/19 08:25:40 sasu
128 # Revision
1.1 2000/07/13 06:30:55 michael
131 # Revision
1.4 2000/01/07 16:41:42 daniel
134 # Revision
1.3 2000/01/07 16:32:28 daniel
135 # * copyright
2000 added
137 # Revision
1.2 1999/05/03 23:30:29 peter
139 # * uses gprt1 again
for gprt21 becuase gprt21
.as crashes
141 # Revision
1.1 1999/05/03 21:29:36 peter
142 # + glibc
2.1 support
144 # Revision
1.3 1998/11/04 10:16:25 peter
145 # + xorl ebp
,ebp to indicate end of backtrace
147 # Revision
1.2 1998/10/14 21:28:46 peter
148 # * initialize fpu so sigfpe
is finally generated
for fpu errors
150 # Revision
1.1 1998/08/12 19:16:09 peter
151 # + loader including libc init and exit