dllprt0.as 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 %edx,operatingsystem_parameter_envp /* Move the environment pointer */
  31. movl %eax,operatingsystem_parameter_argc /* Move the argument counter */
  32. movl %ecx,operatingsystem_parameter_argv /* Move the argument pointer */
  33. movb $1,U_SYSTEM_ISLIBRARY
  34. call PASCALMAIN
  35. leave
  36. ret
  37. .globl _haltproc
  38. .type _haltproc,@function
  39. _haltproc:
  40. _haltproc2: # GAS <= 2.15 bug: generates larger jump if a label is exported
  41. xorl %eax,%eax
  42. incl %eax /* eax=1, exit call */
  43. movzwl operatingsystem_result,%ebx
  44. int $0x80
  45. jmp _haltproc2
  46. .bss
  47. .comm operatingsystem_parameter_envp,4
  48. .comm operatingsystem_parameter_argc,4
  49. .comm operatingsystem_parameter_argv,4
  50. #
  51. # $Log$
  52. # Revision 1.3 2004-07-03 21:50:31 daniel
  53. # * Modified bootstrap code so separate prt0.as/prt0_10.as files are no
  54. # longer necessary
  55. #
  56. # Revision 1.2 2002/09/07 16:01:20 peter
  57. # * old logs removed and tabs fixed
  58. #