commit e809687b2a03e48c4c2387bfeb04d18cad8ab651
parent 737201b0ae652b8e2896c567fa74a05bf8a412e6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 12 Mar 2018 18:06:39 +0100
[nm/coff32] Add support for common blocks
Common blocks use the extern hack, where the value is used to
indicate the size of the block.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nm/coff32.c b/nm/coff32.c
@@ -37,7 +37,7 @@ typeof(SYMENT *ent)
c = 'a';
break;
case N_UNDEF:
- c = 'U';
+ c = (ent->n_value != 0) ? 'C' : 'U';
break;
default:
if (ent->n_scnum > nsect)
@@ -136,6 +136,7 @@ getsymbol(char *fname, FILE *fp,
sym->name = getsname(fname, fp, ent);
sym->type = typeof(ent);
sym->value = ent->n_value;
+ sym->size = (sym->type == 'C') ? ent->n_value : 0;
}
static void