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