diff options
author | markm <markm@FreeBSD.org> | 2002-03-29 22:43:43 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-03-29 22:43:43 +0000 |
commit | 76fe441a7bf75d73962641b785f158b5cc9dc7f8 (patch) | |
tree | 4e267e060bfb6d96f46ab0d79c49b277402c0dd0 /lib/csu/i386/crt0.c | |
parent | 6085f75ded37ec415ded7d6373ecd09bcb088ac4 (diff) | |
download | FreeBSD-src-76fe441a7bf75d73962641b785f158b5cc9dc7f8.zip FreeBSD-src-76fe441a7bf75d73962641b785f158b5cc9dc7f8.tar.gz |
Do not use __progname directly (except in [gs]etprogname(3)).
Also, make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.
Diffstat (limited to 'lib/csu/i386/crt0.c')
-rw-r--r-- | lib/csu/i386/crt0.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c index e1a5551..49431d9 100644 --- a/lib/csu/i386/crt0.c +++ b/lib/csu/i386/crt0.c @@ -37,10 +37,13 @@ #ifdef DYNAMIC #include <sys/types.h> #include <sys/syscall.h> -#include <a.out.h> -#include <string.h> #include <sys/mman.h> + +#include <a.out.h> #include <link.h> +#include <string.h> + +#include "libc_private.h" /* !!! * This is gross, ld.so is a ZMAGIC a.out, but has `sizeof(hdr)' for @@ -88,8 +91,7 @@ static void __do_dynamic_link(char **argv); int _callmain(); int errno; -static char empty[1]; -char *__progname = empty; +const char *__progname = ""; char **environ; /* Globals used by dlopen() and related functions in libc */ @@ -144,6 +146,7 @@ start() register struct kframe *kfp; register char **targv; register char **argv; + register const char *s; extern void _mcleanup(); #ifdef DYNAMIC volatile caddr_t x; @@ -162,7 +165,6 @@ start() environ = targv; if (argv[0]) { - register char *s; __progname = argv[0]; for (s=__progname; *s != '\0'; s++) if (*s == '/') |