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
72 # Must match the alignment we got from crti.o else we get
73 # zero-filled holes in our _fini function and then SIGILL.
77 # Fragment of the ELF _init routine that sets up the frame info.
83 jsr $26,__do_frame_setup
87 # Invoke our destructors in order.
92 # Support recursive calls to exit.
93 .type dtor_ptr,@object
96 .quad __DTOR_LIST__ + 8
98 # A globally unique widget for c++ local destructors to hang off.
100 .type __dso_handle,@object
117 .ent __do_global_dtors_aux
119 __do_global_dtors_aux:
129 # Do c++ local destructors.
130 lda $1,__cxa_finalize
133 jsr $26,__cxa_finalize
147 # Remove our frame info.
148 lda $1,__deregister_frame_info
150 lda $16,__EH_FRAME_BEGIN__
151 jsr $26,__deregister_frame_info
159 .end __do_global_dtors_aux
162 # Install our frame info.
165 # ??? How can we rationally keep this size correct?
168 .type frame_object,@object
169 .size frame_object, 48
177 .ent __do_frame_setup
187 lda $1,__register_frame_info
189 lda $16,__EH_FRAME_BEGIN__
191 jsr $26,__register_frame_info
198 .end __do_frame_setup
200 .weak __register_frame_info
201 .weak __deregister_frame_info