summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorcube <cube@NetBSD.org>2007-09-20 07:50:32 +0000
committercube <cube@NetBSD.org>2007-09-20 07:50:32 +0000
commitf7779133cd0ffdc9c2261edbcdb6ab2a9a9a772b (patch)
tree1281f60a47f3d0e24fdaf57bf178d9e2a6973c33 /libexec
parent0d73c1262a0b748ef21fc89e3a4e558da2f9b215 (diff)
Don't remove the last component of filename before calling
_rtld_digest_dynamic: it is done in expand(), and doing it twice is once too much. This fixes $ORIGIN expansion for dependencies.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.elf_so/load.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libexec/ld.elf_so/load.c b/libexec/ld.elf_so/load.c
index 43fd3badec0..0b071a48fbf 100644
--- a/libexec/ld.elf_so/load.c
+++ b/libexec/ld.elf_so/load.c
@@ -1,4 +1,4 @@
-/* $NetBSD: load.c,v 1.32 2007/05/18 21:44:08 christos Exp $ */
+/* $NetBSD: load.c,v 1.33 2007/09/20 07:50:32 cube Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: load.c,v 1.32 2007/05/18 21:44:08 christos Exp $");
+__RCSID("$NetBSD: load.c,v 1.33 2007/09/20 07:50:32 cube Exp $");
#endif /* not lint */
#include <err.h>
@@ -137,20 +137,11 @@ _rtld_load_object(const char *filepath, int mode)
}
if (obj == NULL) { /* First use of this object, so we must map it in */
- char *p, pathname[MAXPATHLEN];
- const char *q;
-
obj = _rtld_map_object(filepath, fd, &sb);
(void)close(fd);
if (obj == NULL)
return NULL;
-
- (void)strlcpy(pathname, filepath, sizeof(pathname));
- if ((p = strrchr(q = pathname, '/')) != NULL)
- *p = '\0';
- else
- q = ".";
- _rtld_digest_dynamic(q, obj);
+ _rtld_digest_dynamic(filepath, obj);
*_rtld_objtail = obj;
_rtld_objtail = &obj->next;