1 /* Special .init and .fini section support for Alpha. NPTL version.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 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.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 /* This file is compiled into assembly code which is then munged by a sed
20 script into two files: crti.s and crtn.s.
22 * crti.s puts a function prologue at the beginning of the .init and .fini
23 sections and defines global symbols for those addresses, so they can be
26 * crtn.s puts the corresponding function epilogues in the .init and .fini
29 This differs from what would be generated by the generic code in that
30 we save and restore the GP within the function. In order for linker
31 relaxation to work, the value in the GP register on exit from a function
32 must be valid for the function entry point. Normally, a function is
33 contained within one object file and this is not an issue, provided
34 that the function reloads the gp after making any function calls.
35 However, _init and _fini are constructed from pieces of many object
36 files, all of which may have different GP values. So we must reload
37 the GP value from crti.o in crtn.o. */
40 #include \"defs.h\" \n\
44 /*@_init_PROLOG_BEGINS*/ \n\
45 .section .init, \"ax\", @progbits \n\
47 .type _init,@function \n\
54 bsr $26, __pthread_initialize_minimal_internal !samegp \n\
56 /*@_init_PROLOG_ENDS*/ \n\
58 /*@_init_EPILOG_BEGINS*/ \n\
59 .section .init, \"ax\", @progbits \n\
64 /*@_init_EPILOG_ENDS*/ \n\
66 /*@_fini_PROLOG_BEGINS*/ \n\
67 .section .fini, \"ax\", @progbits \n\
69 .type _fini,@function \n\
77 /*@_fini_PROLOG_ENDS*/ \n\
79 /*@_fini_EPILOG_BEGINS*/ \n\
80 .section .fini, \"ax\", @progbits \n\
85 /*@_fini_EPILOG_ENDS*/ \n\
87 /*@TRAILER_BEGINS*/ \n\