commit 6a972ee63bdb46b8fdc57af1740154c7ba576604
parent 3e50e418c633600bac4a41e899147d9e8de78f29
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 7 Jan 2019 18:16:05 +0000
[nm] Restore filter
Last commit remove the filter expressions and this commit
restore them.
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/nm/nm.c b/src/nm/nm.c
@@ -119,6 +119,16 @@ newsym(Symbol *sym, void *data)
struct symtbl *tbl = data;
Symbol **p;
size_t n, size;
+ int type = sym->type;
+
+ if (type == '?' || type == 'N')
+ return 1;
+
+ if (uflag && type != 'U')
+ return 1;
+
+ if (gflag && !isupper(type))
+ return 1;
n = tbl->nsyms+1;
if (n == 0 || n > SIZE_MAX / sizeof(*p))