1 /* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
22 #include <asm/unistd.h>
26 * Arguments for __libc_start_main:
44 alloc r2 = ar.pfs,0,0,7,0
45 movl r3 = FPSR_DEFAULT
48 adds out2 = 16, sp /* get address of argc value */
53 ld8 out1 = [out2], 8 /* load argc and move out2 to become argv */
54 mov.m r10 = ar.bsp /* fetch rbs base address */
60 sub gp = r9, gp /* back-compute gp value */
61 adds out6 = 16, sp /* highest non-environment stack address */
65 addl r11 = @ltoff(__libc_ia64_register_backing_store_base), gp
66 addl out0 = @ltoff(@fptr(main)), gp
67 addl out3 = @ltoff(@fptr(_init)), gp
71 ld8 r3 = [r11] /* pointer to __libc_ia64_register_backing_store_base */
72 ld8 out0 = [out0] /* pointer to `main' function descriptor */
73 addl out4 = @ltoff(@fptr(_fini)), gp
77 ld8 out3 = [out3] /* pointer to `init' function descriptor */
78 ld8 out4 = [out4] /* pointer to `fini' function descriptor */
80 mov r4 = r0 /* terminate unwind chain with a NULL return-pointer */
85 mov out5 = ret0 /* dynamic linker destructor */
86 br.call.sptk.few rp = __libc_start_main
89 break 0 /* break miserably if we ever return */
93 /* Define a symbol for the first piece of initialized data. */
99 data_start = __data_start
101 .common __libc_ia64_register_backing_store_base, 8, 8