Back to index

glibc  2.9
pt-initfini.c
Go to the documentation of this file.
00001 /* Special .init and .fini section support for 64 bit S/390.
00002    Copyright (C) 2003 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it
00006    and/or modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    In addition to the permissions in the GNU Lesser General Public
00011    License, the Free Software Foundation gives you unlimited
00012    permission to link the compiled version of this file with other
00013    programs, and to distribute those programs without any restriction
00014    coming from the use of this file.  (The Lesser General Public
00015    License restrictions do apply in other respects; for example, they
00016    cover modification of the file, and distribution when not linked
00017    into another program.)
00018 
00019    The GNU C Library is distributed in the hope that it will be
00020    useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00021    of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022    GNU Lesser General Public License for more details.
00023 
00024    You should have received a copy of the GNU Lesser General Public
00025    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00026    write to the Free Software Foundation, 59 Temple Place - Suite 330,
00027    Boston, MA 02111-1307, USA.  */
00028 
00029 /* This file is compiled into assembly code which is then munged by a sed
00030    script into two files: crti.s and crtn.s.
00031 
00032    * crti.s puts a function prologue at the beginning of the
00033    .init and .fini sections and defines global symbols for
00034    those addresses, so they can be called as functions.
00035 
00036    * crtn.s puts the corresponding function epilogues
00037    in the .init and .fini sections. */
00038 
00039 __asm__ ("\
00040 \n\
00041 #include \"defs.h\"\n\
00042 \n\
00043 /*@HEADER_ENDS*/\n\
00044 \n\
00045 /*@TESTS_BEGIN*/\n\
00046 \n\
00047 /*@TESTS_END*/\n\
00048 \n\
00049 /*@_init_PROLOG_BEGINS*/\n\
00050 \n\
00051        .section .init\n\
00052 #NO_APP\n\
00053        .align 4\n\
00054 .globl _init\n\
00055        .type   _init,@function\n\
00056 _init:\n\
00057 #      leaf function           0\n\
00058 #      automatics              0\n\
00059 #      outgoing args           0\n\
00060 #      need frame pointer      0\n\
00061 #      call alloca             0\n\
00062 #      has varargs             0\n\
00063 #      incoming args (stack)   0\n\
00064 #      function length         36\n\
00065        STMG   6,15,48(15)\n\
00066        LGR    1,15\n\
00067        AGHI   15,-160\n\
00068        STG    1,0(15)\n\
00069        LARL   12,_GLOBAL_OFFSET_TABLE_\n\
00070        BRASL  14,__pthread_initialize_minimal_internal\n\
00071        LARL   1,__gmon_start__@GOTENT\n\
00072        LG     1,0(1)\n\
00073        LTGR   1,1\n\
00074        JE     .L22\n\
00075        BASR   14,1\n\
00076 .L22:\n\
00077 #APP\n\
00078        .align 4,0x07\n\
00079        END_INIT\n\
00080 \n\
00081 /*@_init_PROLOG_ENDS*/\n\
00082 \n\
00083 /*@_init_EPILOG_BEGINS*/\n\
00084        .align 4\n\
00085        .section .init\n\
00086 #NO_APP\n\
00087        .align 4\n\
00088        LG     4,272(15)\n\
00089        LMG    6,15,208(15)\n\
00090        BR     4\n\
00091 #APP\n\
00092        END_INIT\n\
00093 \n\
00094 /*@_init_EPILOG_ENDS*/\n\
00095 \n\
00096 /*@_fini_PROLOG_BEGINS*/\n\
00097        .section .fini\n\
00098 #NO_APP\n\
00099        .align 4\n\
00100 .globl _fini\n\
00101        .type   _fini,@function\n\
00102 _fini:\n\
00103 #      leaf function           0\n\
00104 #      automatics              0\n\
00105 #      outgoing args           0\n\
00106 #      need frame pointer      0\n\
00107 #      call alloca             0\n\
00108 #      has varargs             0\n\
00109 #      incoming args (stack)   0\n\
00110 #      function length         30\n\
00111        STMG   6,15,48(15)\n\
00112        LGR    1,15\n\
00113        AGHI   15,-160\n\
00114        STG    1,0(15)\n\
00115        LARL   12,_GLOBAL_OFFSET_TABLE_\n\
00116 #APP\n\
00117        .align 4,0x07\n\
00118        END_FINI\n\
00119 \n\
00120 /*@_fini_PROLOG_ENDS*/\n\
00121 \n\
00122 /*@_fini_EPILOG_BEGINS*/\n\
00123        .align 4\n\
00124        .section .fini\n\
00125 #NO_APP\n\
00126        .align 4\n\
00127        LG     4,272(15)\n\
00128        LMG    6,15,208(15)\n\
00129        BR     4\n\
00130 #APP\n\
00131        END_FINI\n\
00132 \n\
00133 /*@_fini_EPILOG_ENDS*/\n\
00134 \n\
00135 /*@TRAILER_BEGINS*/\n\
00136        ");