OSDN Git Service

* config/alpha/alpha.md (sibcall_osf_1): Load destination
[pf3gnuchains/gcc-fork.git] / gcc / config / alpha / crtend.asm
1 /*
2  * Copyright (C) 1996, 2000 Free Software Foundation, Inc.
3  *  Contributed by Richard Henderson (rth@tamu.edu)
4  *
5  * This file is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2, or (at your option) any
8  * later version.
9  * 
10  * In addition to the permissions in the GNU General Public License, the
11  * Free Software Foundation gives you unlimited permission to link the
12  * compiled version of this file with other programs, and to distribute
13  * those programs without any restriction coming from the use of this
14  * file.  (The General Public License restrictions do apply in other
15  * respects; for example, they cover modification of the file, and
16  * distribution when not linked into another program.)
17  * 
18  * This file is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * General Public License for more details.
22  * 
23  * You should have received a copy of the GNU General Public License
24  * along with this program; see the file COPYING.  If not, write to
25  * the Free Software Foundation, 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  * 
28  *    As a special exception, if you link this library with files
29  *    compiled with GCC to produce an executable, this does not cause
30  *    the resulting executable to be covered by the GNU General Public License.
31  *    This exception does not however invalidate any other reasons why
32  *    the executable file might be covered by the GNU General Public License.
33  */
34
35 /*
36  * Tails of the constructor/destructor lists.
37  */
38
39 /* The __*TOR_END__ symbols are not global because when this file is used
40    in a shared library, we do not want the symbol to fall over to the
41    application's lists.  */
42
43 .section .ctors,"aw"
44         .align 3
45 __CTOR_END__:
46         .quad   0
47
48 .section .dtors,"aw"
49         .align 3
50 __DTOR_END__:
51         .quad   0
52
53 .section .jcr,"aw"
54         .align 3
55 __JCR_END__:
56         .quad   0
57
58 .section .eh_frame,"aw"
59 __FRAME_END__:
60         .quad   0
61
62 /*
63  * Fragment of the ELF _init routine that invokes our ctor startup
64  */
65
66 .section .init,"ax"
67
68         /* Since the bits of the _init function are spread across many
69            object files, each potentially with its own GP, we must
70            assume we need to load ours.  Further, our .init section
71            can easily be more than 4MB away from our .text bits so we
72            can't use bsr.  */
73
74         br      $29,1f
75 1:      ldgp    $29,0($29)
76         jsr     $26,__do_global_ctors_aux
77
78         /* Must match the alignment we got from crti.o else we get
79            zero-filled holes in our _init function and thense SIGILL.  */
80         .align 3
81
82 /*
83  * Invoke our constructors in order.
84  */
85
86 .text
87
88         .align 3
89         .ent __do_global_ctors_aux
90
91 __do_global_ctors_aux:
92         ldgp    $29,0($27)
93         lda     $30,-16($30)
94         .frame  $30,16,$26,0
95         stq     $9,8($30)
96         stq     $26,0($30)
97         .mask   0x4000200,-16
98         .prologue 1
99
100         lda     $9,__CTOR_END__-8
101         br      1f
102 0:      jsr     $26,($27)
103 1:      ldq     $27,0($9)
104         subq    $9,8,$9
105         not     $27,$0
106         bne     $0,0b
107
108         ldq     $26,0($30)
109         ldq     $9,8($30)
110         lda     $30,16($30)
111         ret
112
113         .end __do_global_ctors_aux