=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/nm/elf.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/usr.bin/nm/elf.c 2004/08/19 19:23:08 1.7 +++ src/usr.bin/nm/elf.c 2004/08/20 04:42:51 1.8 @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.c,v 1.7 2004/08/19 19:23:08 mickey Exp $ */ +/* $OpenBSD: elf.c,v 1.8 2004/08/20 04:42:51 mickey Exp $ */ /* * Copyright (c) 2003 Michael Shalayeff @@ -199,6 +199,27 @@ } break; + case STT_OBJECT: + np->n_type = N_DATA; + switch (sym->st_shndx) { + case SHN_ABS: + np->n_type = N_ABS; + break; + case SHN_COMMON: + np->n_type = N_COMM; + break; + default: + if (sym->st_shndx >= eh->e_shnum) + break; + else if (!strcmp(sn, ELF_SBSS)) + np->n_type = N_BSS; + else if (!strcmp(sn, ELF_BSS)) + np->n_type = N_BSS; + else if (!strcmp(sn, ELF_RODATA)) + np->n_other = 'r'; + } + break; + case STT_FUNC: np->n_type = N_TEXT; if (ELF_ST_BIND(sym->st_info) == STB_WEAK) { @@ -214,20 +235,17 @@ np->n_other = '?'; break; - case STT_OBJECT: - np->n_type = N_DATA; - if (sym->st_shndx == SHN_ABS) + case STT_SECTION: + switch (sym->st_shndx) { + case SHN_ABS: np->n_type = N_ABS; - if (sym->st_shndx == SHN_COMMON) + break; + case SHN_COMMON: np->n_type = N_COMM; - else if (sym->st_shndx >= eh->e_shnum) break; - else if (!strcmp(sn, ELF_SBSS)) - np->n_type = N_BSS; - else if (!strcmp(sn, ELF_BSS)) - np->n_type = N_BSS; - else if (!strcmp(sn, ELF_RODATA)) - np->n_other = 'r'; + default: + np->n_other = '?'; + } break; case STT_FILE: