]>
Commit | Line | Data |
---|---|---|
136d4332 UD |
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 | |
cc7375ce | 7 | and/or modify it under the terms of the GNU Lesser General Public |
136d4332 | 8 | License as published by the Free Software Foundation; either |
cc7375ce | 9 | version 2.1 of the License, or (at your option) any later version. |
136d4332 | 10 | |
cc7375ce | 11 | In addition to the permissions in the GNU Lesser General Public |
136d4332 UD |
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 | |
cc7375ce | 15 | coming from the use of this file. (The Lesser General Public |
136d4332 UD |
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 | |
cc7375ce | 23 | GNU Lesser General Public License for more details. |
136d4332 | 24 | |
cc7375ce | 25 | You should have received a copy of the GNU Lesser General Public |
136d4332 UD |
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. */ | |
29 | ||
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. | |
32 | ||
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. | |
36 | ||
37 | * crtn.s puts the corresponding function epilogues | |
38 | in the .init and .fini sections. */ | |
39 | ||
db0a052c UD |
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\ | |
120 | \n\ | |
121 | /*@_fini_PROLOG_ENDS*/\n\ | |
122 | \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\ | |
133 | \n\ | |
134 | /*@_fini_EPILOG_ENDS*/\n\ | |
135 | \n\ | |
136 | /*@TRAILER_BEGINS*/\n\ | |
137 | "); |