chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / linuxthreads / sysdeps / unix / sysv / linux / s390 / s390-32 / pt-initfini.c
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
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
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.)
18
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.
23
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.  */
28
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.
31
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.
35
36    * crtn.s puts the corresponding function epilogues
37    in the .init and .fini sections. */
38
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         STM     6,15,24(15)\n\
66         BRAS    13,.LTN1_0\n\
67 .LT1_0:\n\
68 .LC13:\n\
69         .long   __pthread_initialize_minimal@PLT-.LT1_0\n\
70 .LC14:\n\
71         .long   __gmon_start__@GOT\n\
72 .LC15:\n\
73         .long   _GLOBAL_OFFSET_TABLE_-.LT1_0\n\
74 .LTN1_0:\n\
75         LR      1,15\n\
76         AHI     15,-96\n\
77         ST      1,0(15)\n\
78         L       12,.LC15-.LT1_0(13)\n\
79         AR      12,13\n\
80         L     1,.LC13-.LT1_0(13)\n\
81         LA    1,0(1,13)\n\
82         BASR  14,1\n\
83         L     1,.LC14-.LT1_0(13)\n\
84         L     1,0(1,12)\n\
85         LTR   1,1\n\
86         JE    .L22\n\
87         BASR  14,1\n\
88 .L22:\n\
89 #APP\n\
90         .align 4,0x07\n\
91         END_INIT\n\
92 \n\
93 /*@_init_PROLOG_ENDS*/\n\
94 \n\
95 /*@_init_EPILOG_BEGINS*/\n\
96         .align 4\n\
97         .section .init\n\
98 #NO_APP\n\
99         .align 4\n\
100         L       4,152(15)\n\
101         LM      6,15,120(15)\n\
102         BR      4\n\
103 #APP\n\
104         END_INIT\n\
105 \n\
106 /*@_init_EPILOG_ENDS*/\n\
107 \n\
108 /*@_fini_PROLOG_BEGINS*/\n\
109         .section .fini\n\
110 #NO_APP\n\
111         .align 4\n\
112 .globl _fini\n\
113         .type    _fini,@function\n\
114 _fini:\n\
115 #       leaf function           0\n\
116 #       automatics              0\n\
117 #       outgoing args           0\n\
118 #       need frame pointer      0\n\
119 #       call alloca             0\n\
120 #       has varargs             0\n\
121 #       incoming args (stack)   0\n\
122 #       function length         30\n\
123         STM     6,15,24(15)\n\
124         BRAS    13,.LTN2_0\n\
125 .LT2_0:\n\
126 .LC17:\n\
127         .long   _GLOBAL_OFFSET_TABLE_-.LT2_0\n\
128 .LTN2_0:\n\
129         LR      1,15\n\
130         AHI     15,-96\n\
131         ST      1,0(15)\n\
132         L       12,.LC17-.LT2_0(13)\n\
133         AR      12,13\n\
134 #APP\n\
135         .align 4,0x07\n\
136         END_FINI\n\
137 \n\
138 /*@_fini_PROLOG_ENDS*/\n\
139 \n\
140 /*@_fini_EPILOG_BEGINS*/\n\
141         .align 4\n\
142         .section .fini\n\
143 #NO_APP\n\
144         .align 4\n\
145         L       4,152(15)\n\
146         LM      6,15,120(15)\n\
147         BR      4\n\
148 #APP\n\
149         END_FINI\n\
150 \n\
151 /*@_fini_EPILOG_ENDS*/\n\
152 \n\
153 /*@TRAILER_BEGINS*/\
154 ");