dllprt0.as 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 2001 by Peter Vreman
  5. #
  6. # See the file COPYING.FPC, included in this distribution,
  7. # for details about the copyright.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY;without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. #
  13. #**********************************************************************}
  14. #
  15. # Linux ELF shared library startup code for Free Pascal
  16. #
  17. .file "dllprt0.as"
  18. .text
  19. .globl _startlib
  20. .type _startlib,@function
  21. _startlib:
  22. .globl FPC_LIB_START
  23. .type FPC_LIB_START,@function
  24. FPC_LIB_START:
  25. pushl %ebp
  26. movl %esp,%ebp
  27. movl 8(%ebp),%eax
  28. movl 12(%ebp),%ecx
  29. movl 16(%ebp),%edx
  30. movl %eax,U_SYSTEM_ARGC /* Move the argument counter */
  31. movl %ecx,U_SYSTEM_ARGV /* Move the argument pointer */
  32. movl %edx,U_SYSTEM_ENVP /* Move the environment pointer */
  33. movb $1,U_SYSTEM_ISLIBRARY
  34. call PASCALMAIN
  35. leave
  36. ret
  37. .globl _haltproc
  38. .type _haltproc,@function
  39. _haltproc:
  40. movl $1,%eax /* exit call */
  41. xorl %ebx,%ebx
  42. movw U_SYSTEM_EXITCODE,%bx
  43. int $0x80
  44. jmp _haltproc
  45. #
  46. # $Log$
  47. # Revision 1.2 2002-09-07 16:01:20 peter
  48. # * old logs removed and tabs fixed
  49. #