diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-30 15:35:14 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-11-30 15:35:14 +0000 |
commit | dcc3ace41893195299ba3dc388d45db10a728f68 (patch) | |
tree | 32f1f9bfd90c29e816bd3bf27511fa941c7524e8 /usr.sbin | |
parent | 00cb3e5ffe52864f93140090213f5b0daa591163 (diff) |
be better about the STT_NOTYPE symbols, not all become N_UNDEF this way; pefo@ ok
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/kvm_mkdb/nlist.c | 22 |
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; |