diff options
author | 2004-01-30 23:14:32 +0000 | |
---|---|---|
committer | 2004-01-30 23:14:32 +0000 | |
commit | 96d3a764c91d8061248feecc1c911a81763bdab3 (patch) | |
tree | ba5d3c36d69cfb10a7731a0afd146205f2555e96 /lib/libc | |
parent | install exref; includes updates to sync with current behaviour; (diff) | |
download | wireguard-openbsd-96d3a764c91d8061248feecc1c911a81763bdab3.tar.xz wireguard-openbsd-96d3a764c91d8061248feecc1c911a81763bdab3.zip |
Fix a logic thinko I made in rev. 1.27. This fixes nlist when
the user passes in a symbol name with an underscore pre-pended
on ELF systems.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/nlist.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 16030a9c431..c16def262f4 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: nlist.c,v 1.46 2003/08/27 17:16:00 mickey Exp $"; +static char rcsid[] = "$OpenBSD: nlist.c,v 1.47 2004/01/30 23:14:32 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -436,9 +436,9 @@ __elf_fdnlist(fd, list) /* * First we check for the symbol as it was - * provided by the user. If that fails, - * skip the first char if it's an '_' and - * try again. + * provided by the user. If that fails + * and the first char is an '_', skip over + * the '_' and try again. * XXX - What do we do when the user really * wants '_foo' and the are symbols * for both 'foo' and '_foo' in the @@ -446,7 +446,7 @@ __elf_fdnlist(fd, list) */ sym = p->n_un.n_name; if (strcmp(&strtab[soff], sym) != 0 && - ((sym[0] == '_') && + (sym[0] != '_' || strcmp(&strtab[soff], sym + 1) != 0)) continue; |