2 * Copyright 2001 David E. O'Brien
4 * Copyright 1996-1998 John D. Polstra.
6 * Copyright (c) 1995 Christopher G. Demetriou
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed for the FreeBSD Project.
20 * See http://www.freebsd.org/ for information about FreeBSD.
21 * This product includes software developed by Christopher G. Demetriou
22 * for the NetBSD Project.
23 * 4. The name of the author may not be used to endorse or promote products
24 * derived from this software without specific prior written permission
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 * $FreeBSD: src/lib/csu/alpha/crt1.c,v 1.7.2.2 2001/08/01 09:30:36 obrien Exp $
38 * $DragonFly: src/lib/csu/alpha/Attic/crt1.c,v 1.2 2003/06/17 04:26:41 dillon Exp $
42 #error "GCC is needed to compile this file"
48 struct Struct_Obj_Entry;
54 extern void _init(void);
55 extern void _fini(void);
56 extern int main(int, char **, char **);
59 extern void _mcleanup(void);
60 extern void monstartup(void *, void *);
66 char *__progname = "";
68 /* The entry function. */
71 void (*cleanup)(void), /* from shared loader */
72 struct Struct_Obj_Entry *obj, /* from shared loader */
73 struct ps_strings *ps_strings)
83 if(argc > 0 && argv[0] != NULL) {
86 for (s = __progname; *s != '\0'; s++)
91 if (&_DYNAMIC != NULL)
99 monstartup(&eprol, &etext);
102 exit( main(argc, argv, env) );
108 __asm__(".previous");
112 * NOTE: Leave the RCS ID _after_ __start(), in case it gets placed in .text.