pt-initfini.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /* Special .init and .fini section support for S/390.
  2. Copyright (C) 2000, 2001 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it
  5. and/or modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. In addition to the permissions in the GNU Lesser General Public
  9. License, the Free Software Foundation gives you unlimited
  10. permission to link the compiled version of this file with other
  11. programs, and to distribute those programs without any restriction
  12. coming from the use of this file. (The Lesser General Public
  13. License restrictions do apply in other respects; for example, they
  14. cover modification of the file, and distribution when not linked
  15. into another program.)
  16. The GNU C Library is distributed in the hope that it will be
  17. useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  18. of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. GNU Lesser General Public License for more details.
  20. You should have received a copy of the GNU Lesser General Public
  21. License along with the GNU C Library; see the file COPYING.LIB. If not,
  22. write to the Free Software Foundation, 59 Temple Place - Suite 330,
  23. Boston, MA 02111-1307, USA. */
  24. /* This file is compiled into assembly code which is then munged by a sed
  25. script into two files: crti.s and crtn.s.
  26. * crti.s puts a function prologue at the beginning of the
  27. .init and .fini sections and defines global symbols for
  28. those addresses, so they can be called as functions.
  29. * crtn.s puts the corresponding function epilogues
  30. in the .init and .fini sections. */
  31. __asm__ ("\
  32. \n\
  33. #include \"defs.h\"\n\
  34. \n\
  35. /*@HEADER_ENDS*/\n\
  36. \n\
  37. /*@TESTS_BEGIN*/\n\
  38. \n\
  39. /*@TESTS_END*/\n\
  40. \n\
  41. /*@_init_PROLOG_BEGINS*/\n\
  42. \n\
  43. .section .init\n\
  44. #NO_APP\n\
  45. .align 4\n\
  46. .globl _init\n\
  47. .type _init,@function\n\
  48. _init:\n\
  49. # leaf function 0\n\
  50. # automatics 0\n\
  51. # outgoing args 0\n\
  52. # need frame pointer 0\n\
  53. # call alloca 0\n\
  54. # has varargs 0\n\
  55. # incoming args (stack) 0\n\
  56. # function length 36\n\
  57. STM 6,15,24(15)\n\
  58. BRAS 13,.LTN1_0\n\
  59. .LT1_0:\n\
  60. .LC13:\n\
  61. .long __pthread_initialize_minimal@PLT-.LT1_0\n\
  62. .LC14:\n\
  63. .long __gmon_start__@GOT\n\
  64. .LC15:\n\
  65. .long _GLOBAL_OFFSET_TABLE_-.LT1_0\n\
  66. .LTN1_0:\n\
  67. LR 1,15\n\
  68. AHI 15,-96\n\
  69. ST 1,0(15)\n\
  70. L 12,.LC15-.LT1_0(13)\n\
  71. AR 12,13\n\
  72. L 1,.LC13-.LT1_0(13)\n\
  73. LA 1,0(1,13)\n\
  74. BASR 14,1\n\
  75. L 1,.LC14-.LT1_0(13)\n\
  76. L 1,0(1,12)\n\
  77. LTR 1,1\n\
  78. JE .L22\n\
  79. BASR 14,1\n\
  80. .L22:\n\
  81. #APP\n\
  82. .align 4,0x07\n\
  83. END_INIT\n\
  84. \n\
  85. /*@_init_PROLOG_ENDS*/\n\
  86. \n\
  87. /*@_init_EPILOG_BEGINS*/\n\
  88. .align 4\n\
  89. .section .init\n\
  90. #NO_APP\n\
  91. .align 4\n\
  92. L 4,152(15)\n\
  93. LM 6,15,120(15)\n\
  94. BR 4\n\
  95. #APP\n\
  96. END_INIT\n\
  97. \n\
  98. /*@_init_EPILOG_ENDS*/\n\
  99. \n\
  100. /*@_fini_PROLOG_BEGINS*/\n\
  101. .section .fini\n\
  102. #NO_APP\n\
  103. .align 4\n\
  104. .globl _fini\n\
  105. .type _fini,@function\n\
  106. _fini:\n\
  107. # leaf function 0\n\
  108. # automatics 0\n\
  109. # outgoing args 0\n\
  110. # need frame pointer 0\n\
  111. # call alloca 0\n\
  112. # has varargs 0\n\
  113. # incoming args (stack) 0\n\
  114. # function length 30\n\
  115. STM 6,15,24(15)\n\
  116. BRAS 13,.LTN2_0\n\
  117. .LT2_0:\n\
  118. .LC17:\n\
  119. .long _GLOBAL_OFFSET_TABLE_-.LT2_0\n\
  120. .LTN2_0:\n\
  121. LR 1,15\n\
  122. AHI 15,-96\n\
  123. ST 1,0(15)\n\
  124. L 12,.LC17-.LT2_0(13)\n\
  125. AR 12,13\n\
  126. #APP\n\
  127. .align 4,0x07\n\
  128. END_FINI\n\
  129. \n\
  130. /*@_fini_PROLOG_ENDS*/\n\
  131. \n\
  132. /*@_fini_EPILOG_BEGINS*/\n\
  133. .align 4\n\
  134. .section .fini\n\
  135. #NO_APP\n\
  136. .align 4\n\
  137. L 4,152(15)\n\
  138. LM 6,15,120(15)\n\
  139. BR 4\n\
  140. #APP\n\
  141. END_FINI\n\
  142. \n\
  143. /*@_fini_EPILOG_ENDS*/\n\
  144. \n\
  145. /*@TRAILER_BEGINS*/\
  146. ");