summaryrefslogtreecommitdiffstats
path: root/usr.sbin/kvm_mkdb/nlist.c
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2002-11-30 15:35:13 +0000
committermickey <mickey@openbsd.org>2002-11-30 15:35:13 +0000
commit89290fbfb1700824463c88ca64d1f71c61c1b330 (patch)
treef7d032344e35ddd5ce54a0f2d472487547456e11 /usr.sbin/kvm_mkdb/nlist.c
parentdead e (diff)
downloadwireguard-openbsd-89290fbfb1700824463c88ca64d1f71c61c1b330.tar.xz
wireguard-openbsd-89290fbfb1700824463c88ca64d1f71c61c1b330.zip
be better about the STT_NOTYPE symbols, not all become N_UNDEF this way; pefo@ ok
Diffstat (limited to 'usr.sbin/kvm_mkdb/nlist.c')
-rw-r--r--usr.sbin/kvm_mkdb/nlist.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c
index fa5858f851f..d370d644d34 100644
--- a/usr.sbin/kvm_mkdb/nlist.c
+++ b/usr.sbin/kvm_mkdb/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.29 2002/10/25 21:55:01 mickey Exp $ */
+/* $OpenBSD: nlist.c,v 1.30 2002/11/30 15:35:13 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.29 2002/10/25 21:55:01 mickey Exp $";
+static char *rcsid = "$OpenBSD: nlist.c,v 1.30 2002/11/30 15:35:13 mickey Exp $";
#endif
#endif /* not lint */
@@ -423,7 +423,20 @@ __elf_knlist(fd, db, ksyms)
/* XXX type conversion is pretty rude... */
switch(ELF_ST_TYPE(sbuf.st_info)) {
case STT_NOTYPE:
- nbuf.n_type = N_UNDF;
+ switch (sbuf.st_shndx) {
+ case SHN_UNDEF:
+ nbuf.n_type = N_UNDF;
+ break;
+ case SHN_ABS:
+ nbuf.n_type = N_ABS;
+ break;
+ case SHN_COMMON:
+ nbuf.n_type = N_COMM;
+ break;
+ default:
+ nbuf.n_type = N_COMM | N_EXT;
+ break;
+ }
break;
case STT_FUNC:
nbuf.n_type = N_TEXT;
@@ -431,6 +444,9 @@ __elf_knlist(fd, db, ksyms)
case STT_OBJECT:
nbuf.n_type = N_DATA;
break;
+ case STT_FILE:
+ nbuf.n_type = N_FN;
+ break;
}
if(ELF_ST_BIND(sbuf.st_info) == STB_LOCAL)
nbuf.n_type = N_EXT;