mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 06:19:28 +02:00
* removed aout entries
This commit is contained in:
parent
507fe53545
commit
77af080111
@ -13,11 +13,10 @@
|
|||||||
#
|
#
|
||||||
#**********************************************************************}
|
#**********************************************************************}
|
||||||
#
|
#
|
||||||
# Linux ELF startup code with profiling support for Free Pascal
|
# Linux ELF startup code for Free Pascal
|
||||||
# Note: Needs linking with -lgmon and -lc
|
|
||||||
#
|
#
|
||||||
|
|
||||||
.file "gprt1.as"
|
.file "prt1.as"
|
||||||
.text
|
.text
|
||||||
.globl _start
|
.globl _start
|
||||||
.type _start,@function
|
.type _start,@function
|
||||||
@ -35,20 +34,27 @@ _start:
|
|||||||
movl %ecx,U_SYSLINUX_ARGC /* Move the argument counter */
|
movl %ecx,U_SYSLINUX_ARGC /* Move the argument counter */
|
||||||
movl %ebx,U_SYSLINUX_ARGV /* Move the argument pointer */
|
movl %ebx,U_SYSLINUX_ARGV /* Move the argument pointer */
|
||||||
|
|
||||||
finit /* initialize fpu */
|
movl %eax,__environ /* libc environ */
|
||||||
fwait
|
|
||||||
fldcw ___fpucw
|
|
||||||
|
|
||||||
pushl $_etext /* Initialize gmon */
|
pushl %eax
|
||||||
pushl $_start
|
pushl %ebx
|
||||||
call monstartup
|
pushl %ecx
|
||||||
addl $8,%esp
|
|
||||||
pushl $_mcleanup
|
call __libc_init /* init libc */
|
||||||
|
movzwl __fpu_control,%eax
|
||||||
|
pushl %eax
|
||||||
|
call __setfpucw
|
||||||
|
addl $4,%esp
|
||||||
|
pushl $_fini
|
||||||
call atexit
|
call atexit
|
||||||
addl $4,%esp
|
addl $4,%esp
|
||||||
|
call _init
|
||||||
|
|
||||||
|
popl %eax
|
||||||
|
popl %eax
|
||||||
|
|
||||||
xorl %ebp,%ebp
|
xorl %ebp,%ebp
|
||||||
call PASCALMAIN
|
call PASCALMAIN /* start the program */
|
||||||
|
|
||||||
.globl _haltproc
|
.globl _haltproc
|
||||||
.type _haltproc,@function
|
.type _haltproc,@function
|
||||||
@ -67,8 +73,6 @@ _haltproc:
|
|||||||
|
|
||||||
.data
|
.data
|
||||||
.align 4
|
.align 4
|
||||||
___fpucw:
|
|
||||||
.long 0x1332
|
|
||||||
|
|
||||||
.globl ___fpc_brk_addr /* heap management */
|
.globl ___fpc_brk_addr /* heap management */
|
||||||
.type ___fpc_brk_addr,@object
|
.type ___fpc_brk_addr,@object
|
||||||
@ -82,15 +86,24 @@ ___fpc_brk_addr:
|
|||||||
__curbrk:
|
__curbrk:
|
||||||
.long 0
|
.long 0
|
||||||
|
|
||||||
|
.globl __environ
|
||||||
|
.type __environ,@object
|
||||||
|
.size __environ,4
|
||||||
|
__environ:
|
||||||
|
.long 0
|
||||||
|
|
||||||
#
|
#
|
||||||
# $Log$
|
# $Log$
|
||||||
# Revision 1.5 1998-11-04 10:16:27 peter
|
# Revision 1.1 1999-11-08 23:07:48 peter
|
||||||
|
# * removed aout entries
|
||||||
|
#
|
||||||
|
# Revision 1.3 1998/11/04 10:16:25 peter
|
||||||
# + xorl ebp,ebp to indicate end of backtrace
|
# + xorl ebp,ebp to indicate end of backtrace
|
||||||
#
|
#
|
||||||
# Revision 1.4 1998/10/14 21:28:48 peter
|
# Revision 1.2 1998/10/14 21:28:46 peter
|
||||||
# * initialize fpu so sigfpe is finally generated for fpu errors
|
# * initialize fpu so sigfpe is finally generated for fpu errors
|
||||||
#
|
#
|
||||||
# Revision 1.3 1998/08/08 14:42:10 peter
|
# Revision 1.1 1998/08/12 19:16:09 peter
|
||||||
# * added missing ___fpc_sbrk and logs
|
# + loader including libc init and exit
|
||||||
#
|
#
|
||||||
#
|
#
|
@ -13,21 +13,27 @@
|
|||||||
#
|
#
|
||||||
#**********************************************************************}
|
#**********************************************************************}
|
||||||
#
|
#
|
||||||
# Linux a.out startup code with profiling support for Free Pascal
|
# Linux ELF startup code with profiling support for Free Pascal
|
||||||
# Note: Needs linking with -lgmon and -lc
|
# Note: Needs linking with -lgmon and -lc
|
||||||
#
|
#
|
||||||
|
|
||||||
.file "gprt0.as"
|
.file "gprt1.as"
|
||||||
.text
|
.text
|
||||||
.globl __entry
|
.globl _start
|
||||||
__entry:
|
.type _start,@function
|
||||||
movl 8(%esp),%eax /* Move the environment pointer */
|
_start:
|
||||||
movl 4(%esp),%ebx /* Move the argument pointer */
|
/* First locate the start of the environment variables */
|
||||||
movl (%esp),%ecx /* Move the argument counter */
|
popl %ecx
|
||||||
|
movl %esp,%ebx /* Points to the arguments */
|
||||||
|
movl %ecx,%eax
|
||||||
|
incl %eax
|
||||||
|
shll $2,%eax
|
||||||
|
addl %esp,%eax
|
||||||
|
andl $0xfffffff8,%esp /* Align stack */
|
||||||
|
|
||||||
movl %eax,U_SYSLINUX_ENVP
|
movl %eax,U_SYSLINUX_ENVP /* Move the environment pointer */
|
||||||
movl %ebx,U_SYSLINUX_ARGV
|
movl %ecx,U_SYSLINUX_ARGC /* Move the argument counter */
|
||||||
movl %ecx,U_SYSLINUX_ARGC
|
movl %ebx,U_SYSLINUX_ARGV /* Move the argument pointer */
|
||||||
|
|
||||||
finit /* initialize fpu */
|
finit /* initialize fpu */
|
||||||
fwait
|
fwait
|
||||||
@ -68,6 +74,7 @@ ___fpucw:
|
|||||||
.type ___fpc_brk_addr,@object
|
.type ___fpc_brk_addr,@object
|
||||||
.size ___fpc_brk_addr,4
|
.size ___fpc_brk_addr,4
|
||||||
___fpc_brk_addr:
|
___fpc_brk_addr:
|
||||||
|
.long 0
|
||||||
|
|
||||||
.globl __curbrk /* necessary for libc */
|
.globl __curbrk /* necessary for libc */
|
||||||
.type __curbrk,@object
|
.type __curbrk,@object
|
||||||
@ -77,13 +84,16 @@ __curbrk:
|
|||||||
|
|
||||||
#
|
#
|
||||||
# $Log$
|
# $Log$
|
||||||
# Revision 1.5 1998-11-04 10:16:26 peter
|
# Revision 1.6 1999-11-08 23:07:48 peter
|
||||||
|
# * removed aout entries
|
||||||
|
#
|
||||||
|
# Revision 1.5 1998/11/04 10:16:27 peter
|
||||||
# + xorl ebp,ebp to indicate end of backtrace
|
# + xorl ebp,ebp to indicate end of backtrace
|
||||||
#
|
#
|
||||||
# Revision 1.4 1998/10/14 21:28:47 peter
|
# Revision 1.4 1998/10/14 21:28:48 peter
|
||||||
# * initialize fpu so sigfpe is finally generated for fpu errors
|
# * initialize fpu so sigfpe is finally generated for fpu errors
|
||||||
#
|
#
|
||||||
# Revision 1.3 1998/08/08 14:42:09 peter
|
# Revision 1.3 1998/08/08 14:42:10 peter
|
||||||
# * added missing ___fpc_sbrk and logs
|
# * added missing ___fpc_sbrk and logs
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
# This file is part of the Free Pascal run time library.
|
# This file is part of the Free Pascal run time library.
|
||||||
# Copyright (c) 1996-98 by Michael Van Canneyt
|
# Copyright (c) 1993,97 by Michael Van Canneyt and Peter Vreman
|
||||||
# member of the Free Pascal development team.
|
# members of the Free Pascal development team.
|
||||||
#
|
#
|
||||||
# See the file COPYING.FPC, included in this distribution,
|
# See the file COPYING.FPC, included in this distribution,
|
||||||
# for details about the copyright.
|
# for details about the copyright.
|
||||||
@ -13,20 +13,26 @@
|
|||||||
#
|
#
|
||||||
#**********************************************************************}
|
#**********************************************************************}
|
||||||
#
|
#
|
||||||
# Linux a.out startup code for Free Pascal
|
# Linux ELF startup code for Free Pascal
|
||||||
#
|
#
|
||||||
|
|
||||||
.file "prt0.as"
|
.file "prt1.as"
|
||||||
.text
|
.text
|
||||||
.globl __entry
|
.globl _start
|
||||||
__entry:
|
.type _start,@function
|
||||||
movl 8(%esp),%eax /* Move the environment pointer */
|
_start:
|
||||||
movl 4(%esp),%ebx /* Move the argument pointer */
|
/* First locate the start of the environment variables */
|
||||||
movl (%esp),%ecx /* Move the argument counter */
|
popl %ecx
|
||||||
|
movl %esp,%ebx /* Points to the arguments */
|
||||||
|
movl %ecx,%eax
|
||||||
|
incl %eax
|
||||||
|
shll $2,%eax
|
||||||
|
addl %esp,%eax
|
||||||
|
andl $0xfffffff8,%esp /* Align stack */
|
||||||
|
|
||||||
movl %eax,U_SYSLINUX_ENVP
|
movl %eax,U_SYSLINUX_ENVP /* Move the environment pointer */
|
||||||
movl %ebx,U_SYSLINUX_ARGV
|
movl %ecx,U_SYSLINUX_ARGC /* Move the argument counter */
|
||||||
movl %ecx,U_SYSLINUX_ARGC
|
movl %ebx,U_SYSLINUX_ARGV /* Move the argument pointer */
|
||||||
|
|
||||||
finit /* initialize fpu */
|
finit /* initialize fpu */
|
||||||
fwait
|
fwait
|
||||||
@ -55,15 +61,24 @@ ___fpucw:
|
|||||||
___fpc_brk_addr:
|
___fpc_brk_addr:
|
||||||
.long 0
|
.long 0
|
||||||
|
|
||||||
|
.globl __curbrk /* necessary for libc */
|
||||||
|
.type __curbrk,@object
|
||||||
|
.size __curbrk,4
|
||||||
|
__curbrk:
|
||||||
|
.long 0
|
||||||
|
|
||||||
#
|
#
|
||||||
# $Log$
|
# $Log$
|
||||||
# Revision 1.5 1998-11-04 10:16:28 peter
|
# Revision 1.6 1999-11-08 23:07:48 peter
|
||||||
|
# * removed aout entries
|
||||||
|
#
|
||||||
|
# Revision 1.5 1998/11/04 10:16:29 peter
|
||||||
# + xorl ebp,ebp to indicate end of backtrace
|
# + xorl ebp,ebp to indicate end of backtrace
|
||||||
#
|
#
|
||||||
# Revision 1.4 1998/10/14 21:28:49 peter
|
# Revision 1.4 1998/10/14 21:28:50 peter
|
||||||
# * initialize fpu so sigfpe is finally generated for fpu errors
|
# * initialize fpu so sigfpe is finally generated for fpu errors
|
||||||
#
|
#
|
||||||
# Revision 1.3 1998/08/08 14:42:11 peter
|
# Revision 1.3 1998/08/08 14:42:12 peter
|
||||||
# * added missing ___fpc_sbrk and logs
|
# * added missing ___fpc_sbrk and logs
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -1,81 +0,0 @@
|
|||||||
#
|
|
||||||
# $Id$
|
|
||||||
# This file is part of the Free Pascal run time library.
|
|
||||||
# Copyright (c) 1993,97 by Michael Van Canneyt and Peter Vreman
|
|
||||||
# members of the Free Pascal development team.
|
|
||||||
#
|
|
||||||
# See the file COPYING.FPC, included in this distribution,
|
|
||||||
# for details about the copyright.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY;without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
#
|
|
||||||
#**********************************************************************}
|
|
||||||
#
|
|
||||||
# Linux ELF startup code for Free Pascal
|
|
||||||
#
|
|
||||||
|
|
||||||
.file "prt1.as"
|
|
||||||
.text
|
|
||||||
.globl _start
|
|
||||||
.type _start,@function
|
|
||||||
_start:
|
|
||||||
/* First locate the start of the environment variables */
|
|
||||||
popl %ecx
|
|
||||||
movl %esp,%ebx /* Points to the arguments */
|
|
||||||
movl %ecx,%eax
|
|
||||||
incl %eax
|
|
||||||
shll $2,%eax
|
|
||||||
addl %esp,%eax
|
|
||||||
andl $0xfffffff8,%esp /* Align stack */
|
|
||||||
|
|
||||||
movl %eax,U_SYSLINUX_ENVP /* Move the environment pointer */
|
|
||||||
movl %ecx,U_SYSLINUX_ARGC /* Move the argument counter */
|
|
||||||
movl %ebx,U_SYSLINUX_ARGV /* Move the argument pointer */
|
|
||||||
|
|
||||||
finit /* initialize fpu */
|
|
||||||
fwait
|
|
||||||
fldcw ___fpucw
|
|
||||||
|
|
||||||
xorl %ebp,%ebp
|
|
||||||
call PASCALMAIN
|
|
||||||
|
|
||||||
.globl _haltproc
|
|
||||||
.type _haltproc,@function
|
|
||||||
_haltproc:
|
|
||||||
movl $1,%eax /* exit call */
|
|
||||||
xorl %ebx,%ebx
|
|
||||||
movw U_SYSLINUX_EXITCODE,%bx
|
|
||||||
int $0x80
|
|
||||||
jmp _haltproc
|
|
||||||
|
|
||||||
.data
|
|
||||||
.align 4
|
|
||||||
___fpucw:
|
|
||||||
.long 0x1332
|
|
||||||
|
|
||||||
.globl ___fpc_brk_addr /* heap management */
|
|
||||||
.type ___fpc_brk_addr,@object
|
|
||||||
.size ___fpc_brk_addr,4
|
|
||||||
___fpc_brk_addr:
|
|
||||||
.long 0
|
|
||||||
|
|
||||||
.globl __curbrk /* necessary for libc */
|
|
||||||
.type __curbrk,@object
|
|
||||||
.size __curbrk,4
|
|
||||||
__curbrk:
|
|
||||||
.long 0
|
|
||||||
|
|
||||||
#
|
|
||||||
# $Log$
|
|
||||||
# Revision 1.5 1998-11-04 10:16:29 peter
|
|
||||||
# + xorl ebp,ebp to indicate end of backtrace
|
|
||||||
#
|
|
||||||
# Revision 1.4 1998/10/14 21:28:50 peter
|
|
||||||
# * initialize fpu so sigfpe is finally generated for fpu errors
|
|
||||||
#
|
|
||||||
# Revision 1.3 1998/08/08 14:42:12 peter
|
|
||||||
# * added missing ___fpc_sbrk and logs
|
|
||||||
#
|
|
||||||
#
|
|
Loading…
Reference in New Issue
Block a user