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