pt-initfini.c 3.6 KB

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