2 * crt0 startup code for user programs running under Cygmon
4 * Copyright (c) 1998, 2000 Cygnus Support
6 * The authors hereby grant permission to use, copy, modify, distribute,
7 * and license this software and its documentation for any purpose, provided
8 * that existing copyright notices are retained in all copies and that this
9 * notice is included verbatim in any distributions. No written agreement,
10 * license, or royalty fee is required for any of the authorized uses.
11 * Modifications to this software may be copyrighted by their authors
12 * and need not follow the licensing terms described here, provided that
13 * the new terms are clearly indicated on the first page of each file where
17 #define _S2(P,X) P ## X
18 #define _S1(P,X) _S2(P,X)
19 #define SYM(X) _S1(__USER_LABEL_PREFIX__,X)
34 /* see if the stack is already setup. if not, then default
35 * to using the value of %sp as set by the ROM monitor
44 movl $__bss_start, %edi
50 pushl $SYM(__sigtramp)
52 call SYM(__install_signal_handler)
55 pushl $SYM(__do_global_dtors)
59 call SYM(__do_global_ctors)
62 call SYM(__get_program_arguments)
72 /* call exit from the C library so atexit gets called, and the
73 * C++ destructors get run. This calls our exit routine below