scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 9e95fc16a44446b7a6ec958a0f92ebda68715e25
parent 9fce9b25b1e7a0f8818b4fd1e55f56c0e361cfff
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 29 Oct 2021 21:54:44 +0200

nm: Add flag -f

This flag is intended for full output, and it forces
to print all the symbols, included those symbols that
are usually suppresed.

Diffstat:
Msrc/cmd/nm.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/cmd/nm.c b/src/cmd/nm.c @@ -24,6 +24,7 @@ static int Aflag; static int vflag; static int gflag; static int uflag; +static int fflag; static char *filename, *membname; static void @@ -125,8 +126,8 @@ newsym(Symbol *sym, struct symtbl *tbl) size_t n, size; int type = sym->type; - if (type == '?' - || type == 'N' + if (type == '?' && !fflag + || type == 'N' && !fflag || uflag && type != 'U' || gflag && !isupper(type)) { return 0; @@ -238,7 +239,7 @@ nm(char *fname) static void usage(void) { - fputs("nm [-APv][ -g| -u][-t format] [file...]\n", stderr); + fputs("nm [-APvf][-g|-u][-t format] [file...]\n", stderr); exit(1); } @@ -257,6 +258,9 @@ main(int argc, char *argv[]) case 'g': gflag = 1; break; + case 'f': + fflag = 1; + break; case 'u': uflag = 1; break;