dllprt0.as 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. |
  2. | $Id: dllprt0.as,v 1.1.2.4 2001/08/01 13:26:17 pierre Exp $
  3. | This file is part of the Free Pascal run time library.
  4. | Copyright (c) 2001 by Pierre Muller
  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 m68k 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_SHARED_LIB_START
  23. .type FPC_SHARED_LIB_START,@function
  24. # This is a normal C function with args (argc,argv,envp)
  25. FPC_SHARED_LIB_START:
  26. link.w %a6,#0
  27. move.l 8(%fp),%d0
  28. move.l %d0,operatingsystem_parameter_argc
  29. move.l 12(%fp),%d0
  30. move.l %d0,operatingsystem_parameter_argv
  31. move.l 16(%fp),%d0
  32. move.l %d0,operatingsystem_parameter_envp
  33. jsr PASCALMAIN
  34. unlk %a6
  35. rts
  36. .size FPC_SHARED_LIB_START,.-FPC_SHARED_LIB_START
  37. .globl _haltproc
  38. .type _haltproc,@function
  39. _haltproc:
  40. moveq.l #1,%d0
  41. move.w operatingsystem_result,%d1
  42. trap #0
  43. bra _haltproc
  44. .size _haltproc,.-_haltproc
  45. .data
  46. .align 4
  47. .globl ___fpc_brk_addr
  48. ___fpc_brk_addr:
  49. .long 0
  50. .bss
  51. .type __stkptr,@object
  52. .size __stkptr,4
  53. .global __stkptr
  54. __stkptr:
  55. .skip 4
  56. .type operatingsystem_parameters,@object
  57. .size operatingsystem_parameters,12
  58. operatingsystem_parameters:
  59. .skip 3*4
  60. .global operatingsystem_parameter_envp
  61. .global operatingsystem_parameter_argc
  62. .global operatingsystem_parameter_argv
  63. .set operatingsystem_parameter_envp,operatingsystem_parameters+0
  64. .set operatingsystem_parameter_argc,operatingsystem_parameters+4
  65. .set operatingsystem_parameter_argv,operatingsystem_parameters+8