Deleted Added
full compact
crt1.c (92447) crt1.c (93399)
1/*
2 * Copyright 2001 David E. O'Brien
3 * All rights reserved.
4 * Copyright (c) 1995, 1998 Berkeley Software Design, Inc.
5 * All rights reserved.
6 * Copyright 1996-1998 John D. Polstra.
7 * All rights reserved.
8 *

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

29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef __GNUC__
33#error "GCC is needed to compile this file"
34#endif
35
36#include <stdlib.h>
1/*
2 * Copyright 2001 David E. O'Brien
3 * All rights reserved.
4 * Copyright (c) 1995, 1998 Berkeley Software Design, Inc.
5 * All rights reserved.
6 * Copyright 1996-1998 John D. Polstra.
7 * All rights reserved.
8 *

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

29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef __GNUC__
33#error "GCC is needed to compile this file"
34#endif
35
36#include <stdlib.h>
37#include "libc_private.h"
37#include "crtbrand.c"
38
39struct Struct_Obj_Entry;
40struct ps_strings;
41
42#pragma weak _DYNAMIC
43extern int _DYNAMIC;
44

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

50#ifdef GCRT
51extern void _mcleanup(void);
52extern void monstartup(void *, void *);
53extern int eprol;
54extern int etext;
55#endif
56
57char **environ;
38#include "crtbrand.c"
39
40struct Struct_Obj_Entry;
41struct ps_strings;
42
43#pragma weak _DYNAMIC
44extern int _DYNAMIC;
45

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

51#ifdef GCRT
52extern void _mcleanup(void);
53extern void monstartup(void *, void *);
54extern int eprol;
55extern int etext;
56#endif
57
58char **environ;
58char *__progname = "";
59const char *__progname = "";
59
60/* The entry function. */
61/*
62 *
63 * %o0 holds ps_strings pointer. For Solaris compat and/or shared
64 * libraries, if %g1 is not 0, it is a routine to pass to atexit().
65 * (By passing the pointer in the usual argument register, we avoid
66 * having to do any inline assembly, except to recover %g1.)

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

72_start(char **ap,
73 void (*cleanup)(void), /* from shared loader */
74 struct Struct_Obj_Entry *obj, /* from shared loader */
75 struct ps_strings *ps_strings)
76{
77 int argc;
78 char **argv;
79 char **env;
60
61/* The entry function. */
62/*
63 *
64 * %o0 holds ps_strings pointer. For Solaris compat and/or shared
65 * libraries, if %g1 is not 0, it is a routine to pass to atexit().
66 * (By passing the pointer in the usual argument register, we avoid
67 * having to do any inline assembly, except to recover %g1.)

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

73_start(char **ap,
74 void (*cleanup)(void), /* from shared loader */
75 struct Struct_Obj_Entry *obj, /* from shared loader */
76 struct ps_strings *ps_strings)
77{
78 int argc;
79 char **argv;
80 char **env;
81 const char *s;
80#if 0
81 void (*term)(void);
82
83 /* Grab %g1 before it gets used for anything by the compiler. */
84 /* Sparc ELF psABI specifies a termination routine (if any) will be in
85 %g1 */
86 __asm__ volatile("mov %%g1,%0" : "=r"(term));
87#endif
88
89 argc = * (long *) ap;
90 argv = ap + 1;
91 env = ap + 2 + argc;
92 environ = env;
93 if (argc > 0 && argv[0] != NULL) {
82#if 0
83 void (*term)(void);
84
85 /* Grab %g1 before it gets used for anything by the compiler. */
86 /* Sparc ELF psABI specifies a termination routine (if any) will be in
87 %g1 */
88 __asm__ volatile("mov %%g1,%0" : "=r"(term));
89#endif
90
91 argc = * (long *) ap;
92 argv = ap + 1;
93 env = ap + 2 + argc;
94 environ = env;
95 if (argc > 0 && argv[0] != NULL) {
94 char *s;
95 __progname = argv[0];
96 for (s = __progname; *s != '\0'; s++)
97 if (*s == '/')
98 __progname = s + 1;
99 }
100
101 __sparc_utrap_setup();
102#if 0

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

123}
124
125#ifdef GCRT
126__asm__(".text");
127__asm__("eprol:");
128__asm__(".previous");
129#endif
130
96 __progname = argv[0];
97 for (s = __progname; *s != '\0'; s++)
98 if (*s == '/')
99 __progname = s + 1;
100 }
101
102 __sparc_utrap_setup();
103#if 0

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

124}
125
126#ifdef GCRT
127__asm__(".text");
128__asm__("eprol:");
129__asm__(".previous");
130#endif
131
131__asm__(".ident\t\"$FreeBSD: head/lib/csu/sparc64/crt1.c 92447 2002-03-16 20:38:46Z obrien $\"");
132__asm__(".ident\t\"$FreeBSD: head/lib/csu/sparc64/crt1.c 93399 2002-03-29 22:43:43Z markm $\"");