OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libpthread / linuxthreads / sysdeps / unix / sysv / linux / s390 / s390-64 / pt-initfini.c
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
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.
10
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.)
19
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.
24
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    see <http://www.gnu.org/licenses/>.  */
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         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@PLT\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\
119 \n\
120 /*@_fini_PROLOG_ENDS*/\n\
121 \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\
132 \n\
133 /*@_fini_EPILOG_ENDS*/\n\
134 \n\
135 /*@TRAILER_BEGINS*/\n\
136         ");