Deleted Added
full compact
crt1.c (216338) crt1.c (232832)
1/* LINTLIBRARY */
2/*-
3 * Copyright 2001 David E. O'Brien.
4 * All rights reserved.
5 * Copyright 1996-1998 John D. Polstra.
6 * All rights reserved.
7 * Copyright (c) 1997 Jason R. Thorpe.
8 * Copyright (c) 1995 Christopher G. Demetriou

--- 26 unchanged lines hidden (view full) ---

35 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#include <sys/cdefs.h>
1/* LINTLIBRARY */
2/*-
3 * Copyright 2001 David E. O'Brien.
4 * All rights reserved.
5 * Copyright 1996-1998 John D. Polstra.
6 * All rights reserved.
7 * Copyright (c) 1997 Jason R. Thorpe.
8 * Copyright (c) 1995 Christopher G. Demetriou

--- 26 unchanged lines hidden (view full) ---

35 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/lib/csu/arm/crt1.c 216338 2010-12-09 21:31:21Z dim $");
43__FBSDID("$FreeBSD: head/lib/csu/arm/crt1.c 232832 2012-03-11 20:04:09Z kib $");
44
45#ifndef lint
46#ifndef __GNUC__
47#error "GCC is needed to compile this file"
48#endif
49#endif /* lint */
50
51#include <stdlib.h>
52
53#include "libc_private.h"
54#include "crtbrand.c"
44
45#ifndef lint
46#ifndef __GNUC__
47#error "GCC is needed to compile this file"
48#endif
49#endif /* lint */
50
51#include <stdlib.h>
52
53#include "libc_private.h"
54#include "crtbrand.c"
55#include "ignore_init.c"
55
56struct Struct_Obj_Entry;
57struct ps_strings;
58
56
57struct Struct_Obj_Entry;
58struct ps_strings;
59
59extern int _DYNAMIC;
60#pragma weak _DYNAMIC
61
62extern void _fini(void);
63extern void _init(void);
64extern int main(int, char **, char **);
65extern void _start(int, char **, char **, const struct Struct_Obj_Entry *,
66 void (*)(void), struct ps_strings *);
67
68#ifdef GCRT
69extern void _mcleanup(void);
70extern void monstartup(void *, void *);
71extern int eprol;
72extern int etext;
73#endif
74
60extern void _start(int, char **, char **, const struct Struct_Obj_Entry *,
61 void (*)(void), struct ps_strings *);
62
63#ifdef GCRT
64extern void _mcleanup(void);
65extern void monstartup(void *, void *);
66extern int eprol;
67extern int etext;
68#endif
69
75char **environ;
76const char *__progname = "";
77struct ps_strings *__ps_strings;
78
79void __start(int, char **, char **, struct ps_strings *,
80 const struct Struct_Obj_Entry *, void (*)(void));
81
82/* The entry function. */
83__asm(" .text \n"
84" .align 0 \n"

--- 14 unchanged lines hidden (view full) ---

99" str r4, [sp, #0] \n"
100"\n"
101" b __start ");
102/* ARGSUSED */
103void
104__start(int argc, char **argv, char **env, struct ps_strings *ps_strings,
105 const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void))
106{
70struct ps_strings *__ps_strings;
71
72void __start(int, char **, char **, struct ps_strings *,
73 const struct Struct_Obj_Entry *, void (*)(void));
74
75/* The entry function. */
76__asm(" .text \n"
77" .align 0 \n"

--- 14 unchanged lines hidden (view full) ---

92" str r4, [sp, #0] \n"
93"\n"
94" b __start ");
95/* ARGSUSED */
96void
97__start(int argc, char **argv, char **env, struct ps_strings *ps_strings,
98 const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void))
99{
107 const char *s;
108
109 environ = env;
110
100
101 environ = env;
102
111 if (argc > 0 && argv[0] != NULL) {
112 __progname = argv[0];
113 for (s = __progname; *s != '\0'; s++)
114 if (*s == '/')
115 __progname = s + 1;
116 }
103 if (argc > 0 && argv[0] != NULL)
104 handle_progname(argv[0]);
117
118 if (ps_strings != (struct ps_strings *)0)
119 __ps_strings = ps_strings;
120
121 if (&_DYNAMIC != NULL)
122 atexit(cleanup);
123 else
124 _init_tls();
125#ifdef GCRT
126 atexit(_mcleanup);
105
106 if (ps_strings != (struct ps_strings *)0)
107 __ps_strings = ps_strings;
108
109 if (&_DYNAMIC != NULL)
110 atexit(cleanup);
111 else
112 _init_tls();
113#ifdef GCRT
114 atexit(_mcleanup);
127#endif
128 atexit(_fini);
129#ifdef GCRT
130 monstartup(&eprol, &etext);
131#endif
115 monstartup(&eprol, &etext);
116#endif
132 _init();
133 exit( main(argc, argv, env) );
117 handle_static_init(argc, argv, env);
118 exit(main(argc, argv, env));
134}
135
136#ifdef GCRT
137__asm__(".text");
138__asm__("eprol:");
139__asm__(".previous");
140#endif
119}
120
121#ifdef GCRT
122__asm__(".text");
123__asm__("eprol:");
124__asm__(".previous");
125#endif