dllprt0.as 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 %sp,__stkptr
  28. move.l 8(%fp),%d0
  29. move.l %d0,operatingsystem_parameter_argc
  30. move.l 12(%fp),%d0
  31. move.l %d0,operatingsystem_parameter_argv
  32. move.l 16(%fp),%d0
  33. move.l %d0,operatingsystem_parameter_envp
  34. jsr PASCALMAIN
  35. unlk %a6
  36. rts
  37. .size FPC_SHARED_LIB_START,.-FPC_SHARED_LIB_START
  38. .globl _haltproc
  39. .type _haltproc,@function
  40. _haltproc:
  41. moveq.l #1,%d0
  42. move.w operatingsystem_result,%d1
  43. trap #0
  44. bra _haltproc
  45. .size _haltproc,.-_haltproc
  46. .data
  47. .align 4
  48. .globl ___fpc_brk_addr
  49. ___fpc_brk_addr:
  50. .long 0
  51. .bss
  52. .type __stkptr,@object
  53. .size __stkptr,4
  54. .global __stkptr
  55. __stkptr:
  56. .skip 4
  57. .type operatingsystem_parameters,@object
  58. .size operatingsystem_parameters,12
  59. operatingsystem_parameters:
  60. .skip 3*4
  61. .global operatingsystem_parameter_envp
  62. .global operatingsystem_parameter_argc
  63. .global operatingsystem_parameter_argv
  64. .set operatingsystem_parameter_envp,operatingsystem_parameters+0
  65. .set operatingsystem_parameter_argc,operatingsystem_parameters+4
  66. .set operatingsystem_parameter_argv,operatingsystem_parameters+8