sol-ci.S 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # crti.s for sysv4
  2. # Copyright (C) 1996-2022 Free Software Foundation, Inc.
  3. # Written By Michael Meissner
  4. #
  5. # This file is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU General Public License as published by the
  7. # Free Software Foundation; either version 3, or (at your option) any
  8. # later version.
  9. #
  10. # This file is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # Under Section 7 of GPL version 3, you are granted additional
  16. # permissions described in the GCC Runtime Library Exception, version
  17. # 3.1, as published by the Free Software Foundation.
  18. #
  19. # You should have received a copy of the GNU General Public License and
  20. # a copy of the GCC Runtime Library Exception along with this program;
  21. # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  22. # <http://www.gnu.org/licenses/>.
  23. # This file just supplies labeled starting points for the .got* and other
  24. # special sections. It is linked in first before other modules.
  25. .ident "GNU C scrti.s"
  26. #ifndef __powerpc64__
  27. # Start of .text
  28. .section ".text"
  29. .globl _ex_text0
  30. _ex_text0:
  31. # Exception range
  32. .section ".exception_ranges","aw"
  33. .globl _ex_range0
  34. _ex_range0:
  35. # List of C++ constructors
  36. .section ".ctors","aw"
  37. .globl __CTOR_LIST__
  38. .type __CTOR_LIST__,@object
  39. __CTOR_LIST__:
  40. # List of C++ destructors
  41. .section ".dtors","aw"
  42. .globl __DTOR_LIST__
  43. .type __DTOR_LIST__,@object
  44. __DTOR_LIST__:
  45. # Head of _init function used for static constructors
  46. .section ".init","ax"
  47. .align 2
  48. .globl _init
  49. .type _init,@function
  50. _init: stwu %r1,-16(%r1)
  51. mflr %r0
  52. stw %r31,12(%r1)
  53. stw %r0,16(%r1)
  54. bl _GLOBAL_OFFSET_TABLE_-4 # get the GOT address
  55. mflr %r31
  56. # lwz %r3,_ex_shared0@got(%r31)
  57. # lwz %r4,-8(%r3) # _ex_register or 0
  58. # cmpi %cr0,%r4,0
  59. # beq .Lno_reg
  60. # mtlr %r4
  61. # blrl
  62. #.Lno_reg:
  63. # Head of _fini function used for static destructors
  64. .section ".fini","ax"
  65. .align 2
  66. .globl _fini
  67. .type _fini,@function
  68. _fini: stwu %r1,-16(%r1)
  69. mflr %r0
  70. stw %r31,12(%r1)
  71. stw %r0,16(%r1)
  72. bl _GLOBAL_OFFSET_TABLE_-4 # get the GOT address
  73. mflr %r31
  74. # _environ and its evil twin environ, pointing to the environment
  75. .section ".sdata","aw"
  76. .align 2
  77. .globl _environ
  78. .space 4
  79. .weak environ
  80. .set environ,_environ
  81. #endif