arch/m68k-amiga: Define the gcc symbol 'start' instead of using .bss
[AROS.git] / compiler / clib / arosc_startup.c
blobe123a60d31f520bba0a053c39e5cb334091073e2
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: autoinit library - arosc.library specific code
6 Lang: english
7 */
8 #include <proto/arosc.h>
10 #include <aros/symbolsets.h>
11 #include <aros/startup.h>
13 #define DEBUG 0
14 #include <aros/debug.h>
16 void __arosc_program_startup(void);
17 void __arosc_program_end(void);
19 static void __arosc_startup(void)
21 struct arosc_userdata *udata = __get_arosc_userdata();
23 D(bug("[__arosc_startup] Start, base 0x%p, userdata 0x%p\n", aroscbase, udata));
25 __arosc_program_startup();
27 D(bug("[__arosc_startup] Library startup called, error %d\n", __startup_error));
28 udata->acud_startup_error = __startup_error;
30 if (setjmp(udata->acud_startup_jmp_buf) == 0)
32 D(bug("[__arosc_startup] setjmp() called\n"));
33 __startup_entries_next();
35 else
37 D(bug("[__arosc_startup] setjmp() return from longjmp\n"));
38 __startup_error = udata->acud_startup_error;
41 __arosc_program_end();
43 D(bug("[__arosc_startup] Leave\n"));
46 ADD2SET(__arosc_startup, program_entries, 0);