Deleted Added
full compact
crt1_c.c (91430) crt1_c.c (93399)
1/*-
2 * Copyright 1996-1998 John D. Polstra.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

24 */
25
26#ifndef __GNUC__
27#error "GCC is needed to compile this file"
28#endif
29
30#include <stddef.h>
31#include <stdlib.h>
1/*-
2 * Copyright 1996-1998 John D. Polstra.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

24 */
25
26#ifndef __GNUC__
27#error "GCC is needed to compile this file"
28#endif
29
30#include <stddef.h>
31#include <stdlib.h>
32#include "libc_private.h"
32#include "crtbrand.c"
33
34typedef void (*fptr)(void);
35
36extern void _fini(void);
37extern void _init(void);
38extern int main(int, char **, char **);
39

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

52 ({ fptr __value; \
53 __asm__("movl %%edx,%0" : "=rm"(__value)); \
54 __value; })
55#else
56#error "This file only supports the i386 architecture"
57#endif
58
59char **environ;
33#include "crtbrand.c"
34
35typedef void (*fptr)(void);
36
37extern void _fini(void);
38extern void _init(void);
39extern int main(int, char **, char **);
40

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

53 ({ fptr __value; \
54 __asm__("movl %%edx,%0" : "=rm"(__value)); \
55 __value; })
56#else
57#error "This file only supports the i386 architecture"
58#endif
59
60char **environ;
60char *__progname = "";
61const char *__progname = "";
61
62void
63_start(char *arguments, ...)
64{
65 fptr rtld_cleanup;
66 int argc;
67 char **argv;
68 char **env;
62
63void
64_start(char *arguments, ...)
65{
66 fptr rtld_cleanup;
67 int argc;
68 char **argv;
69 char **env;
70 const char *s;
69
70 rtld_cleanup = get_rtld_cleanup();
71 argv = &arguments;
72 argc = * (int *) (argv - 1);
73 env = argv + argc + 1;
74 environ = env;
75 if (argc > 0 && argv[0] != NULL) {
71
72 rtld_cleanup = get_rtld_cleanup();
73 argv = &arguments;
74 argc = * (int *) (argv - 1);
75 env = argv + argc + 1;
76 environ = env;
77 if (argc > 0 && argv[0] != NULL) {
76 char *s;
77 __progname = argv[0];
78 for (s = __progname; *s != '\0'; s++)
79 if (*s == '/')
80 __progname = s + 1;
81 }
82
83 if (&_DYNAMIC != NULL)
84 atexit(rtld_cleanup);

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

95}
96
97#ifdef GCRT
98__asm__(".text");
99__asm__("eprol:");
100__asm__(".previous");
101#endif
102
78 __progname = argv[0];
79 for (s = __progname; *s != '\0'; s++)
80 if (*s == '/')
81 __progname = s + 1;
82 }
83
84 if (&_DYNAMIC != NULL)
85 atexit(rtld_cleanup);

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

96}
97
98#ifdef GCRT
99__asm__(".text");
100__asm__("eprol:");
101__asm__(".previous");
102#endif
103
103__asm__(".ident\t\"$FreeBSD: head/lib/csu/i386-elf/crt1.c 91430 2002-02-27 22:13:02Z obrien $\"");
104__asm__(".ident\t\"$FreeBSD: head/lib/csu/i386-elf/crt1.c 93399 2002-03-29 22:43:43Z markm $\"");