OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libpthread / 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    see <http://www.gnu.org/licenses/>.  */
27
28 /* This file is compiled into assembly code which is then munged by a sed
29    script into two files: crti.s and crtn.s.
30
31    * crti.s puts a function prologue at the beginning of the
32    .init and .fini sections and defines global symbols for
33    those addresses, so they can be called as functions.
34
35    * crtn.s puts the corresponding function epilogues
36    in the .init and .fini sections. */
37
38 __asm__ ("\
39 \n\
40 #include \"defs.h\"\n\
41 \n\
42 /*@HEADER_ENDS*/\n\
43 \n\
44 /*@TESTS_BEGIN*/\n\
45 \n\
46 /*@TESTS_END*/\n\
47 \n\
48 /*@_init_PROLOG_BEGINS*/\n\
49 \n\
50         .section .init\n\
51 #NO_APP\n\
52         .align 4\n\
53 .globl _init\n\
54         .type    _init,@function\n\
55 _init:\n\
56 #       leaf function           0\n\
57 #       automatics              0\n\
58 #       outgoing args           0\n\
59 #       need frame pointer      0\n\
60 #       call alloca             0\n\
61 #       has varargs             0\n\
62 #       incoming args (stack)   0\n\
63 #       function length         36\n\
64         STM     6,15,24(15)\n\
65         BRAS    13,.LTN1_0\n\
66 .LT1_0:\n\
67 .LC13:\n\
68         .long   __pthread_initialize_minimal@PLT-.LT1_0\n\
69 .LC14:\n\
70         .long   __gmon_start__@GOT\n\
71 .LC15:\n\
72         .long   _GLOBAL_OFFSET_TABLE_-.LT1_0\n\
73 .LTN1_0:\n\
74         LR      1,15\n\
75         AHI     15,-96\n\
76         ST      1,0(15)\n\
77         L       12,.LC15-.LT1_0(13)\n\
78         AR      12,13\n\
79         L     1,.LC13-.LT1_0(13)\n\
80         LA    1,0(1,13)\n\
81         BASR  14,1\n\
82         L     1,.LC14-.LT1_0(13)\n\
83         L     1,0(1,12)\n\
84         LTR   1,1\n\
85         JE    .L22\n\
86         BASR  14,1\n\
87 .L22:\n\
88 #APP\n\
89         .align 4,0x07\n\
90         END_INIT\n\
91 \n\
92 /*@_init_PROLOG_ENDS*/\n\
93 \n\
94 /*@_init_EPILOG_BEGINS*/\n\
95         .align 4\n\
96         .section .init\n\
97 #NO_APP\n\
98         .align 4\n\
99         L       4,152(15)\n\
100         LM      6,15,120(15)\n\
101         BR      4\n\
102 #APP\n\
103         END_INIT\n\
104 \n\
105 /*@_init_EPILOG_ENDS*/\n\
106 \n\
107 /*@_fini_PROLOG_BEGINS*/\n\
108         .section .fini\n\
109 #NO_APP\n\
110         .align 4\n\
111 .globl _fini\n\
112         .type    _fini,@function\n\
113 _fini:\n\
114 #       leaf function           0\n\
115 #       automatics              0\n\
116 #       outgoing args           0\n\
117 #       need frame pointer      0\n\
118 #       call alloca             0\n\
119 #       has varargs             0\n\
120 #       incoming args (stack)   0\n\
121 #       function length         30\n\
122         STM     6,15,24(15)\n\
123         BRAS    13,.LTN2_0\n\
124 .LT2_0:\n\
125 .LC17:\n\
126         .long   _GLOBAL_OFFSET_TABLE_-.LT2_0\n\
127 .LTN2_0:\n\
128         LR      1,15\n\
129         AHI     15,-96\n\
130         ST      1,0(15)\n\
131         L       12,.LC17-.LT2_0(13)\n\
132         AR      12,13\n\
133 #APP\n\
134         .align 4,0x07\n\
135         END_FINI\n\
136 \n\
137 /*@_fini_PROLOG_ENDS*/\n\
138 \n\
139 /*@_fini_EPILOG_BEGINS*/\n\
140         .align 4\n\
141         .section .fini\n\
142 #NO_APP\n\
143         .align 4\n\
144         L       4,152(15)\n\
145         LM      6,15,120(15)\n\
146         BR      4\n\
147 #APP\n\
148         END_FINI\n\
149 \n\
150 /*@_fini_EPILOG_ENDS*/\n\
151 \n\
152 /*@TRAILER_BEGINS*/\
153 ");