version 1.13, 2001/08/17 14:25:26 |
version 1.14, 2001/08/17 16:29:33 |
|
|
#include <unistd.h> |
#include <unistd.h> |
#include <err.h> |
#include <err.h> |
#include <ctype.h> |
#include <ctype.h> |
|
#include <link.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
int rname __P((const void *, const void *)); |
int rname __P((const void *, const void *)); |
int value __P((const void *, const void *)); |
int value __P((const void *, const void *)); |
int (*sfunc) __P((const void *, const void *)) = fname; |
int (*sfunc) __P((const void *, const void *)) = fname; |
|
char *otherstring __P((struct nlist *)); |
|
char *typestring __P((unsigned int)); |
|
char typeletter __P((unsigned int)); |
|
|
|
|
/* some macros for symbol type (nlist.n_type) handling */ |
/* some macros for symbol type (nlist.n_type) handling */ |
|
|
const char *objname; |
const char *objname; |
struct nlist *sym; |
struct nlist *sym; |
{ |
{ |
char *typestring(), typeletter(), *otherstring(); |
|
|
|
if (print_file_each_line) |
if (print_file_each_line) |
(void)printf("%s:", objname); |
(void)printf("%s:", objname); |
|
|
|
|
sym->n_desc&0xffff, typestring(sym->n_type)); |
sym->n_desc&0xffff, typestring(sym->n_type)); |
else if (show_extensions) |
else if (show_extensions) |
(void)printf(" %c%2s ", typeletter(sym->n_type), |
(void)printf(" %c%2s ", typeletter(sym->n_type), |
otherstring(sym->n_other)); |
otherstring(sym)); |
else |
else |
(void)printf(" %c ", typeletter(sym->n_type)); |
(void)printf(" %c ", typeletter(sym->n_type)); |
} |
} |
|
|
(void)puts(symname(sym)); |
(void)puts(symname(sym)); |
} |
} |
|
|
#define AUX_OBJECT 1 |
|
#define AUX_FUNC 2 |
|
#define BIND_WEAK 2 |
|
|
|
char * |
char * |
otherstring(other) |
otherstring(sym) |
u_char other; |
struct nlist *sym; |
{ |
{ |
static char buf[3]; |
static char buf[3]; |
char *result; |
char *result; |
u_char bindtype; |
|
u_char aux; |
|
|
|
result = buf; |
result = buf; |
|
|
bindtype = other >> 4; |
if (N_BIND(sym) == BIND_WEAK) |
aux = other & 0x0f; |
|
if (bindtype == BIND_WEAK) |
|
*result++ = 'w'; |
*result++ = 'w'; |
if (aux == AUX_OBJECT) |
if (N_AUX(sym) == AUX_OBJECT) |
*result++ = 'o'; |
*result++ = 'o'; |
else if (aux == AUX_FUNC) |
else if (N_AUX(sym) == AUX_FUNC) |
*result++ = 'f'; |
*result++ = 'f'; |
*result++ = 0; |
*result++ = 0; |
return buf; |
return buf; |
|
|
*/ |
*/ |
char * |
char * |
typestring(type) |
typestring(type) |
register u_char type; |
unsigned int type; |
{ |
{ |
switch(type) { |
switch(type) { |
case N_BCOMM: |
case N_BCOMM: |
|
|
*/ |
*/ |
char |
char |
typeletter(type) |
typeletter(type) |
u_char type; |
unsigned int type; |
{ |
{ |
switch(SYMBOL_TYPE(type)) { |
switch(SYMBOL_TYPE(type)) { |
case N_ABS: |
case N_ABS: |