summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-10-25 21:55:02 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-10-25 21:55:02 +0000
commitbab1d726ab6cfb2705e230159e33b3fa66e98fef (patch)
tree07c8795315bdb3499bdf34438bade1ca5220295e
parent423e1ef37c5540abaa226c3155f517b085071f9e (diff)
prepend the underscore always for elf, this makes kvm_bsd.db work on elf platforms; drahn@ millert@ ok
-rw-r--r--usr.sbin/kvm_mkdb/nlist.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c
index e6c665cc3b4..fa5858f851f 100644
--- a/usr.sbin/kvm_mkdb/nlist.c
+++ b/usr.sbin/kvm_mkdb/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.28 2002/09/06 19:04:49 deraadt Exp $ */
+/* $OpenBSD: nlist.c,v 1.29 2002/10/25 21:55:01 mickey Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "from: @(#)nlist.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: nlist.c,v 1.28 2002/09/06 19:04:49 deraadt Exp $";
+static char *rcsid = "$OpenBSD: nlist.c,v 1.29 2002/10/25 21:55:01 mickey Exp $";
#endif
#endif /* not lint */
@@ -420,7 +420,7 @@ __elf_knlist(fd, db, ksyms)
nbuf.n_value = sbuf.st_value;
- /*XXX type conversion is pretty rude... */
+ /* XXX type conversion is pretty rude... */
switch(ELF_ST_TYPE(sbuf.st_info)) {
case STT_NOTYPE:
nbuf.n_type = N_UNDF;
@@ -435,14 +435,9 @@ __elf_knlist(fd, db, ksyms)
if(ELF_ST_BIND(sbuf.st_info) == STB_LOCAL)
nbuf.n_type = N_EXT;
- if(eh.e_machine == EM_MIPS) {
- *buf = '_';
- strcpy(buf+1,strtab + sbuf.st_name);
- key.data = (u_char *)buf;
- }
- else {
- key.data = (u_char *)(strtab + sbuf.st_name);
- }
+ *buf = '_';
+ strcpy(buf + 1, strtab + sbuf.st_name);
+ key.data = (u_char *)buf;
key.size = strlen((char *)key.data);
if (db->put(db, &key, &data, 0))
err(1, "record enter");