summaryrefslogtreecommitdiffstats
path: root/lib/csu/sparc64
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-03-29 22:43:43 +0000
committermarkm <markm@FreeBSD.org>2002-03-29 22:43:43 +0000
commit76fe441a7bf75d73962641b785f158b5cc9dc7f8 (patch)
tree4e267e060bfb6d96f46ab0d79c49b277402c0dd0 /lib/csu/sparc64
parent6085f75ded37ec415ded7d6373ecd09bcb088ac4 (diff)
downloadFreeBSD-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/sparc64')
-rw-r--r--lib/csu/sparc64/Makefile3
-rw-r--r--lib/csu/sparc64/crt1.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/csu/sparc64/Makefile b/lib/csu/sparc64/Makefile
index 566c5d9..5985c8c 100644
--- a/lib/csu/sparc64/Makefile
+++ b/lib/csu/sparc64/Makefile
@@ -5,7 +5,8 @@
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= gcrt1.o
-CFLAGS+= -I${.CURDIR}/../common
+CFLAGS+= -I${.CURDIR}/../common \
+ -I${.CURDIR}/../../libc/include
NOMAN= true
NOPIC= true
NOPROFILE= true
diff --git a/lib/csu/sparc64/crt1.c b/lib/csu/sparc64/crt1.c
index 0c20383..99a63c8 100644
--- a/lib/csu/sparc64/crt1.c
+++ b/lib/csu/sparc64/crt1.c
@@ -34,6 +34,7 @@
#endif
#include <stdlib.h>
+#include "libc_private.h"
#include "crtbrand.c"
struct Struct_Obj_Entry;
@@ -55,7 +56,7 @@ extern int etext;
#endif
char **environ;
-char *__progname = "";
+const char *__progname = "";
/* The entry function. */
/*
@@ -77,6 +78,7 @@ _start(char **ap,
int argc;
char **argv;
char **env;
+ const char *s;
#if 0
void (*term)(void);
@@ -91,7 +93,6 @@ _start(char **ap,
env = ap + 2 + argc;
environ = env;
if (argc > 0 && argv[0] != NULL) {
- char *s;
__progname = argv[0];
for (s = __progname; *s != '\0'; s++)
if (*s == '/')
OpenPOWER on IntegriCloud