1 /* Special startup code for ARM a.out binaries.
2 Copyright (C) 1998 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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. */
25 /* The first piece of initialized data. */
27 #ifdef HAVE_WEAK_SYMBOLS
28 weak_alias (__data_start
, data_start
)
33 strong_alias (__errno
, errno
)
36 extern void __libc_init
__P ((int argc
, char **argv
, char **envp
));
37 extern int main
__P ((int argc
, char **argv
, char **envp
));
39 /* N.B.: It is important that this be the first function.
40 This file is the first thing in the text section. */
42 /* If this was in C it might create its own stack frame and
43 screw up the arguments. */
45 asm (".text; .globl _start; _start: B start1");
47 asm (".text; .globl __start; __start: B _start1");
49 /* Make an alias called `start' (no leading underscore, so it can't
50 conflict with C symbols) for `_start'. This is the name vendor crt0.o's
51 tend to use, and thus the name most linkers expect. */
52 asm (".set start, __start");
55 /* Fool gcc into thinking that more args are passed. This makes it look
56 on the stack (correctly) for the real arguments. It causes somewhat
57 strange register usage in start1(), but we aren't too bothered about
58 that at the moment. */
59 #define DUMMIES a1, a2, a3, a4
62 #define ARG_DUMMIES DUMMIES,
63 #define DECL_DUMMIES int DUMMIES;
71 start1 (ARG_DUMMIES argc
, argv
, envp
)
77 /* Store a pointer to the environment. */
80 /* Do C library initializations. */
81 __libc_init (argc
, argv
, __environ
);
83 /* Call the user program. */
84 exit (main (argc
, argv
, __environ
));