1 # Copyright (C) 1996, 1998 Free Software Foundation, Inc.
2 # Contributed by Richard Henderson (rth@tamu.edu)
4 # This file is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2, or (at your option) any
9 # In addition to the permissions in the GNU General Public License, the
10 # Free Software Foundation gives you unlimited permission to link the
11 # compiled version of this file with other programs, and to distribute
12 # those programs without any restriction coming from the use of this
13 # file. (The General Public License restrictions do apply in other
14 # respects; for example, they cover modification of the file, and
15 # distribution when not linked into another program.)
17 # This file is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; see the file COPYING. If not, write to
24 # the Free Software Foundation, 59 Temple Place - Suite 330,
25 # Boston, MA 02111-1307, USA.
27 # As a special exception, if you link this library with files
28 # compiled with GCC to produce an executable, this does not cause
29 # the resulting executable to be covered by the GNU General Public License.
30 # This exception does not however invalidate any other reasons why
31 # the executable file might be covered by the GNU General Public License.
34 # Heads of the constructor/destructor lists.
37 # The __*TOR_LIST__ symbols are not global because when this file is used
38 # in a shared library, we do not want the symbol to fall over to the
39 # application's lists.
53 .section .eh_frame,"aw"
57 # Fragment of the ELF _fini routine that invokes our dtor cleanup.
62 # Since the bits of the _fini function are spread across many
63 # object files, each potentially with its own GP, we must
64 # assume we need to load ours. Further, our .fini section
65 # can easily be more than 4MB away from our .text bits so we
70 jsr $26,__do_global_dtors_aux
73 # Ideally this call would go in crtend.o, except that we can't
74 # get hold of __EH_FRAME_BEGIN__ there.
76 jsr $26,__do_frame_takedown
78 # Must match the alignment we got from crti.o else we get
79 # zero-filled holes in our _fini function and then SIGILL.
83 # Fragment of the ELF _init routine that sets up the frame info.
89 jsr $26,__do_frame_setup
93 # Invoke our destructors in order.
98 # Support recursive calls to exit.
99 $ptr: .quad __DTOR_LIST__
104 .ent __do_global_dtors_aux
106 __do_global_dtors_aux:
128 .end __do_global_dtors_aux
131 # Install our frame info.
134 # ??? How can we rationally keep this size correct?
137 .type $object,@object
146 .ent __do_frame_setup
156 lda $1,__register_frame_info
158 lda $16,__EH_FRAME_BEGIN__
160 jsr $26,__register_frame_info
165 .end __do_frame_setup
168 # Remove our frame info.
172 .ent __do_frame_takedown
182 lda $1,__deregister_frame_info
184 lda $16,__EH_FRAME_BEGIN__
185 jsr $26,__deregister_frame_info
190 .end __do_frame_takedown
192 .weak __register_frame_info
193 .weak __deregister_frame_info
196 .ascii "$FreeBSD: src/contrib/gcc/config/alpha/crtbegin.asm,v 1.1.1.2.2.3 2001/08/19 00:01:16 obrien Exp $\0"
197 .ascii "$DragonFly: src/contrib/gcc/config/alpha/Attic/crtbegin.asm,v 1.2 2003/06/17 04:24:01 dillon Exp $\0"