version 1.31, 2007/09/02 15:19:33 |
version 1.32, 2009/10/27 23:51:21 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#ifndef lint |
|
static const char copyright[] = |
|
"@(#) Copyright (c) 1989, 1993\n\ |
|
The Regents of the University of California. All rights reserved.\n"; |
|
#endif /* not lint */ |
|
|
|
#if 0 |
|
static const char sccsid[] = "@(#)nm.c 8.1 (Berkeley) 6/6/93"; |
|
#endif |
|
static const char rcsid[] = "$OpenBSD$"; |
|
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/mman.h> |
#include <sys/mman.h> |
#include <a.out.h> |
#include <a.out.h> |
|
|
int show_file(int, int, const char *, FILE *fp, off_t, union hdr *); |
int show_file(int, int, const char *, FILE *fp, off_t, union hdr *); |
void print_symbol(const char *, struct nlist *, int); |
void print_symbol(const char *, struct nlist *, int); |
|
|
#define OPTSTRING_NM "aABCegnoprsuvVw" |
#define OPTSTRING_NM "aABCegnoprsuvw" |
const struct option longopts_nm[] = { |
const struct option longopts_nm[] = { |
{ "debug-syms", no_argument, 0, 'a' }, |
{ "debug-syms", no_argument, 0, 'a' }, |
{ "demangle", no_argument, 0, 'C' }, |
{ "demangle", no_argument, 0, 'C' }, |
|
|
{ "reverse-sort", no_argument, 0, 'r' }, |
{ "reverse-sort", no_argument, 0, 'r' }, |
/* { "size-sort", no_argument, &szval, 1 }, */ |
/* { "size-sort", no_argument, &szval, 1 }, */ |
{ "undefined-only", no_argument, 0, 'u' }, |
{ "undefined-only", no_argument, 0, 'u' }, |
{ "version", no_argument, 0, 'V' }, |
|
{ "help", no_argument, 0, '?' }, |
{ "help", no_argument, 0, '?' }, |
{ NULL } |
{ NULL } |
}; |
}; |
|
|
case 'u': |
case 'u': |
print_only_undefined_symbols = 1; |
print_only_undefined_symbols = 1; |
break; |
break; |
case 'V': |
|
fprintf(stderr, "%s\n", rcsid); |
|
exit(0); |
|
case 'w': |
case 'w': |
non_object_warning = 1; |
non_object_warning = 1; |
break; |
break; |
|
|
if (issize) |
if (issize) |
fprintf(stderr, "usage: %s [-tw] [file ...]\n", __progname); |
fprintf(stderr, "usage: %s [-tw] [file ...]\n", __progname); |
else |
else |
fprintf(stderr, "usage: %s [-aCegnoprsuVw] [file ...]\n", |
fprintf(stderr, "usage: %s [-aCegnoprsuw] [file ...]\n", |
__progname); |
__progname); |
exit(1); |
exit(1); |
} |
} |