summaryrefslogtreecommitdiffstats
path: root/lib/csu/powerpc/crt1.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csu/powerpc/crt1.c')
-rw-r--r--lib/csu/powerpc/crt1.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/lib/csu/powerpc/crt1.c b/lib/csu/powerpc/crt1.c
index 67de2f5..c3be90d 100644
--- a/lib/csu/powerpc/crt1.c
+++ b/lib/csu/powerpc/crt1.c
@@ -52,17 +52,11 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
#include "crtbrand.c"
+#include "ignore_init.c"
struct Struct_Obj_Entry;
struct ps_strings;
-extern int _DYNAMIC;
-#pragma weak _DYNAMIC
-
-extern void _fini(void);
-extern void _init(void);
-extern int main(int, char **, char **);
-
#ifdef GCRT
extern void _mcleanup(void);
extern void monstartup(void *, void *);
@@ -70,8 +64,6 @@ extern int eprol;
extern int etext;
#endif
-char **environ;
-const char *__progname = "";
struct ps_strings *__ps_strings;
void _start(int, char **, char **, const struct Struct_Obj_Entry *,
@@ -88,16 +80,11 @@ _start(int argc, char **argv, char **env,
const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void),
struct ps_strings *ps_strings)
{
- const char *s;
environ = env;
- if (argc > 0 && argv[0] != NULL) {
- __progname = argv[0];
- for (s = __progname; *s != '\0'; s++)
- if (*s == '/')
- __progname = s + 1;
- }
+ if (argc > 0 && argv[0] != NULL)
+ handle_progname(argv[0]);
if (ps_strings != (struct ps_strings *)0)
__ps_strings = ps_strings;
@@ -109,13 +96,11 @@ _start(int argc, char **argv, char **env,
#ifdef GCRT
atexit(_mcleanup);
-#endif
- atexit(_fini);
-#ifdef GCRT
monstartup(&eprol, &etext);
#endif
- _init();
- exit( main(argc, argv, env) );
+
+ handle_static_init(argc, argv, env);
+ exit(main(argc, argv, env));
}
#ifdef GCRT
OpenPOWER on IntegriCloud