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/powerpc | |
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/powerpc')
-rw-r--r-- | lib/csu/powerpc/Makefile | 3 | ||||
-rw-r--r-- | lib/csu/powerpc/crt1.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile index 65dd009..44f1f3a 100644 --- a/lib/csu/powerpc/Makefile +++ b/lib/csu/powerpc/Makefile @@ -6,7 +6,8 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= gcrt1.o CFLAGS+= -Wall -Wno-unused \ - -I${.CURDIR}/../common + -I${.CURDIR}/../common \ + -I${.CURDIR}/../../libc/include NOMAN= true NOPIC= true NOPROFILE= true diff --git a/lib/csu/powerpc/crt1.c b/lib/csu/powerpc/crt1.c index eb293d6..46156eb 100644 --- a/lib/csu/powerpc/crt1.c +++ b/lib/csu/powerpc/crt1.c @@ -43,6 +43,7 @@ #endif #include <stdlib.h> +#include "libc_private.h" #include "crtbrand.c" struct Struct_Obj_Entry; @@ -63,7 +64,7 @@ extern int etext; #endif char **environ; -char *__progname = ""; +const char *__progname = ""; struct ps_strings *__ps_strings; /* The entry function. @@ -80,11 +81,11 @@ _start(argc, argv, envp, obj, cleanup, ps_strings) struct ps_strings *ps_strings; /* BSD extension */ { char *namep; + const char *s; environ = envp; if (argc > 0 && argv[0] != NULL) { - char *s; __progname = argv[0]; for (s = __progname; *s != '\0'; s++) if (*s == '/') |