summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authoretheisen <etheisen@openbsd.org>1997-01-10 18:29:48 +0000
committeretheisen <etheisen@openbsd.org>1997-01-10 18:29:48 +0000
commit8d3323c5b8088fb4afcce904c9e8b4a98957666a (patch)
tree7db3f2da8a24fa667acdafa19706f72a95a9a11c /lib/libc
parentChange all mips ports to use mips-unknown-openbsd2.0 like gcc does. (diff)
downloadwireguard-openbsd-8d3323c5b8088fb4afcce904c9e8b4a98957666a.tar.xz
wireguard-openbsd-8d3323c5b8088fb4afcce904c9e8b4a98957666a.zip
Leading underscores... Actually, they really DID fuck this up on the MIPS
and PPC platforms... Everyone else has _leading!
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/nlist.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 4cc64b045d2..6ea5b91818b 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: nlist.c,v 1.18 1997/01/09 03:49:38 rahnds Exp $";
+static char rcsid[] = "$OpenBSD: nlist.c,v 1.19 1997/01/10 18:29:48 etheisen Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -393,12 +393,16 @@ __elf_fdnlist(fd, list)
if (soff == 0)
continue;
for (p = list; !ISLAST(p); p++) {
- /*
- * ELF ports do not use the leading
- * underscore that is given with "standard"
- * nlist calls as a.out format does.
- */
- if (!strcmp(&strtab[soff], p->n_un.n_name+1)) {
+ /*
+ * XXX - ABI crap, they
+ * really fucked this up
+ * for MIPS and PowerPC
+ */
+ if (!strcmp(&strtab[soff],
+ ((ehdr.e_machine == EM_MIPS) ||
+ (ehdr.e_machine == EM_PPC)) ?
+ p->n_un.n_name+1 :
+ p->n_un.n_name)) {
p->n_value = s->st_value;
/* XXX - type conversion */