dllprt0.as 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2013 by Free Pascal development team
  4. Startup code for elf32-sparc
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. */
  11. .globl FPC_SHARED_LIB_START
  12. .type FPC_SHARED_LIB_START,#function
  13. FPC_SHARED_LIB_START:
  14. save %o6,-96,%o6
  15. call 1f
  16. sethi %hi(_GLOBAL_OFFSET_TABLE_+4),%l7
  17. 1: or %l7,%lo(_GLOBAL_OFFSET_TABLE_+8),%l7
  18. add %l7,%o7,%l7
  19. sethi %hi(operatingsystem_parameter_argc),%o0
  20. or %o0,%lo(operatingsystem_parameter_argc),%o0
  21. ld [%o0+%l7],%o1
  22. st %i0,[%o1]
  23. sethi %hi(operatingsystem_parameter_argv),%o0
  24. or %o0,%lo(operatingsystem_parameter_argv),%o0
  25. ld [%o0+%l7],%o1
  26. st %i1,[%o1]
  27. sethi %hi(operatingsystem_parameter_envp),%o0
  28. or %o0,%lo(operatingsystem_parameter_envp),%o0
  29. ld [%o0+%l7],%o1
  30. st %i2,[%o1]
  31. sethi %hi(__stkptr),%o0
  32. or %o0,%lo(__stkptr),%o0
  33. ld [%o0+%l7],%o1
  34. st %sp,[%o1]
  35. call PASCALMAIN
  36. nop
  37. ret
  38. restore
  39. .size FPC_SHARED_LIB_START,.-FPC_SHARED_LIB_START
  40. .globl _haltproc
  41. .type _haltproc,#function
  42. _haltproc:
  43. mov 188,%g1
  44. ta 16
  45. unimp
  46. .size _haltproc,.-_haltproc
  47. .comm __stkptr,4
  48. .comm __dl_fini,4
  49. .comm operatingsystem_parameter_envp,4
  50. .comm operatingsystem_parameter_argc,4
  51. .comm operatingsystem_parameter_argv,4
  52. .section .note.GNU-stack,"",@progbits