From 0081acc7f020076a4196bf81b8eb3059dac065e4 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 8 Nov 2004 20:47:08 +0000 Subject: 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@ --- gnu/usr.bin/ld/rtld/rtld.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gnu/usr.bin/ld') 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) { -- cgit v1.2.3