summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-11-08 20:47:08 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-11-08 20:47:08 +0000
commit0081acc7f020076a4196bf81b8eb3059dac065e4 (patch)
treed9a5ad0f9a3de1b0d21663fe0929a579ecea6afd /gnu/usr.bin
parent5e6084d6568caa4696954886ddb3015b8112e9ef (diff)
Sync the weak symbol logic with the ELF ld.so, and use N_AUX() instead of
rolling our own version; no functional changes. ok millert@
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/ld/rtld/rtld.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c
index c2e20f8d6f8..87b2652a68b 100644
--- a/gnu/usr.bin/ld/rtld/rtld.c
+++ b/gnu/usr.bin/ld/rtld/rtld.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld.c,v 1.38 2003/08/15 23:13:06 deraadt Exp $ */
+/* $OpenBSD: rtld.c,v 1.39 2004/11/08 20:47:07 miod Exp $ */
/* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -166,7 +166,7 @@ static char us[] = "/usr/libexec/ld.so";
char **environ;
char *__progname = us;
-int errno;
+/* int errno; */
static int careful;
static int anon_fd = -1;
@@ -1119,7 +1119,7 @@ restart:
continue;
if (np->nz_type == N_UNDF+N_EXT && np->nz_value != 0) {
- if (np->nz_other == AUX_FUNC) {
+ if (N_AUX(&np->nlist) == AUX_FUNC) {
/* It's a weak function definition */
if (strong)
continue;
@@ -1130,14 +1130,15 @@ restart:
continue;
}
}
+ if (N_BIND(&np->nlist) != BIND_WEAK) {
+ *src_map = smp;
+ return np;
+ }
if (N_BIND(&np->nlist) == BIND_WEAK && weak_np == 0) {
weak_np = np;
weak_smp = smp;
continue;
}
-
- *src_map = smp;
- return np;
}
if (weak_np) {