OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / e1 / crt1.c
1 /* vi: set sw=4 ts=4: */
2 /* uClibc/sysdeps/linux/m68k/crt0.S
3  * Pull stuff off the stack and get uClibc moving.
4  *
5  * Copyright (C) 2002-2003,    George Thanos <george.thanos@gdt.gr>
6  *                             Yannis Mitsos <yannis.mitsos@gdt.gr>
7  *
8  * Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Library General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or (at your
13  * option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
18  * for more details.
19  *
20  * You should have received a copy of the GNU Library General Public License
21  * along with this program; see the file COPYING.LIB.  If not, see
22  * <http://www.gnu.org/licenses/>.
23  */
24
25 /* Stick in a dummy reference to main(), so that if an application
26  * is linking when the main() function is in a static library (.a)
27  * we can be sure that main() actually gets linked in */
28 extern void main(int argc,void *argv,void *envp);
29 /* void (*mainp)(int argc,void *argv,void *envp) = main; */
30
31 void __uClibc_main(int argc,void *argv,void *envp);
32
33 void _uClibc_start(unsigned int first_arg)
34 {
35         unsigned int argc;
36         char **argv, **envp;
37         unsigned long *stack;
38
39         stack = (unsigned long*) first_arg;
40         argc = *(stack);
41         argv = (char **)(stack + 1);
42         envp = (char **)(stack + 1 + argc + 1);
43
44         __uClibc_main(argc, argv, envp);
45 }
46
47 void __main() { }
48