version 1.2, 2003/06/03 02:56:08 |
version 1.3, 2004/07/20 18:20:55 |
|
|
if (wantsym(&symtab[i], strtab)) |
if (wantsym(&symtab[i], strtab)) |
nname++; |
nname++; |
|
|
|
#ifdef DEBUG |
|
if (debug & ELFDEBUG) { |
|
printf("[getnfile] symtab at %p, strtab at %p\n", symtab, strtab); |
|
printf("[getnfile] %d of %d symbols wanted\n", nname, symtabct); |
|
} |
|
#endif |
|
|
/* Allocate memory for them, plus a terminating entry. */ |
/* Allocate memory for them, plus a terminating entry. */ |
if ((nl = (nltype *)calloc(nname + 1, sizeof(nltype))) == NULL) |
if ((nl = (nltype *)calloc(nname + 1, sizeof(nltype))) == NULL) |
errx(1, "Insufficient memory for symbol table"); |
errx(1, "Insufficient memory for symbol table"); |
|
|
if (wantsym(sym, strtab)) { |
if (wantsym(sym, strtab)) { |
npe->value = sym->st_value; |
npe->value = sym->st_value; |
npe->name = strtab + sym->st_name; |
npe->name = strtab + sym->st_name; |
|
#ifdef DEBUG |
|
if (debug & ELFDEBUG) |
|
printf("[getnfile] symbol %d: %s -> %lx\n", i, |
|
npe->name ? npe->name : "(none)", npe->value); |
|
#endif |
npe++; |
npe++; |
} |
} |
} |
} |