1 /* Copyright (C) 2000 Free Software Foundation, Inc.
2 Contributed by Jes Sorensen, <Jes.Sorensen@cern.ch>
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 .section .ctors,"aw","progbits"
24 .section .dtors,"aw","progbits"
29 .section .IA_64.unwind
34 .type dtor_ptr#,@object
37 data8 __DTOR_LIST__# + 8
39 .type segrel_ofs#,@object
42 data8 @segrel(.Lsegrel_ref#)
44 /* A handle for __cxa_finalize to manage c++ local destructors. */
46 .type __dso_handle#,@object
57 #ifdef HAVE_GAS_HIDDEN
61 /* The frame object. */
62 /* ??? How can we rationally keep this size correct? */
64 .type frame_object#,@object
65 .size frame_object#,64
71 * Fragment of the ELF _fini routine that invokes our dtor cleanup.
73 * We make the call by indirection, because in large programs the
74 * .fini and .init sections are not in range of the destination, and
75 * we cannot allow the linker to insert a stub at the end of this
76 * fragment of the _fini function. Further, Itanium does not implement
77 * the long branch instructions, and we do not wish every program to
78 * trap to the kernel for emulation.
80 * Note that we require __do_global_dtors_aux to preserve the GP,
81 * so that the next fragment in .fini gets the right value.
83 .section .fini,"ax","progbits"
85 movl r2 = @gprel(__do_global_dtors_aux#)
95 br.call.sptk.many b0 = b6
100 * Fragment of the ELF _init routine that sets up the frame info.
103 .section .init,"ax","progbits"
105 movl r2 = @gprel(__do_frame_setup#)
115 br.call.sptk.many b0 = b6
121 .proc __do_global_dtors_aux#
122 __do_global_dtors_aux:
125 alloc loc3 = ar.pfs, 0, 4, 1, 0
126 addl loc0 = @gprel(dtor_ptr#), gp
137 __cxa_finalize(__dso_handle)
140 alloc loc3 = ar.pfs, 0, 4, 1, 0
141 addl loc0 = @gprel(dtor_ptr#), gp
142 addl r16 = @ltoff(@fptr(__cxa_finalize#)), gp
148 addl out0 = @ltoff(__dso_handle#), gp
149 cmp.ne p7, p0 = r0, r16
154 (p7) ld8 r18 = [r16], 8
165 (p7) br.call.sptk.many b0 = b6
186 br.call.sptk.many b0 = b6
196 cmp.ne p6, p0 = r0, r16
197 (p6) br.cond.sptk.few 0b
200 if (__deregister_frame_info)
201 __deregister_frame_info(__EH_FRAME_BEGIN__)
206 addl r16 = @ltoff(@fptr(__deregister_frame_info#)), gp
207 addl out0 = @ltoff(__EH_FRAME_BEGIN__#), gp
216 cmp.ne p7, p0 = r0, r16
218 (p7) ld8 r18 = [r16], 8
224 (p7) br.call.sptk.many b0 = b6
235 .endp __do_global_dtors_aux#
237 .proc __do_frame_setup#
240 if (__register_frame_info)
241 __register_frame_info(__EH_FRAME_BEGIN__)
244 alloc loc2 = ar.pfs, 0, 3, 2, 0
245 addl r16 = @ltoff(@fptr(__register_frame_info#)), gp
246 addl out0 = @ltoff(__EH_FRAME_BEGIN__#), gp
248 /* frame_object.pc_base = segment_base_offset;
249 pc_base is at offset 0 within frame_object. */
252 addl out1 = @ltoff(frame_object#), gp
254 addl r2 = @gprel(segrel_ofs#), gp
266 cmp.ne p7, p0 = r0, r16
272 (p7) ld8 r18 = [r16], 8
282 (p7) br.call.sptk.many b0 = b6
293 .endp __do_frame_setup#
296 .weak __cxa_finalize#
298 .weak __deregister_frame_info#
299 .weak __register_frame_info#