summaryrefslogtreecommitdiffstats
path: root/lib/csu/amd64
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/amd64
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/amd64')
-rw-r--r--lib/csu/amd64/Makefile3
-rw-r--r--lib/csu/amd64/crt1.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile
index cb1bc63..b602a02 100644
--- a/lib/csu/amd64/Makefile
+++ b/lib/csu/amd64/Makefile
@@ -6,7 +6,8 @@ SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= gcrt1.o
CFLAGS+= -elf -Wall -fkeep-inline-functions \
- -I${.CURDIR}/../common
+ -I${.CURDIR}/../common \
+ -I${.CURDIR}/../../libc/include
LDFLAGS+= -elf
NOMAN= true
NOPIC= true
diff --git a/lib/csu/amd64/crt1.c b/lib/csu/amd64/crt1.c
index 60ca5b5..5dcd90e 100644
--- a/lib/csu/amd64/crt1.c
+++ b/lib/csu/amd64/crt1.c
@@ -29,6 +29,7 @@
#include <stddef.h>
#include <stdlib.h>
+#include "libc_private.h"
#include "crtbrand.c"
typedef void (*fptr)(void);
@@ -57,7 +58,7 @@ extern int _DYNAMIC;
#endif
char **environ;
-char *__progname = "";
+const char *__progname = "";
void
_start(char *arguments, ...)
@@ -66,6 +67,7 @@ _start(char *arguments, ...)
int argc;
char **argv;
char **env;
+ const char *s;
rtld_cleanup = get_rtld_cleanup();
argv = &arguments;
@@ -73,7 +75,6 @@ _start(char *arguments, ...)
env = argv + argc + 1;
environ = env;
if (argc > 0 && argv[0] != NULL) {
- char *s;
__progname = argv[0];
for (s = __progname; *s != '\0'; s++)
if (*s == '/')
OpenPOWER on IntegriCloud