Commit 8f14451f authored by Russ Cox's avatar Russ Cox

6l: ignore undefined symbols in gotypesigs.

   they end up in the symbol table with type==0
   if they are in a library but not pulled in.
   also add a few debugging prints.

R=r
DELTA=11  (5 added, 1 deleted, 5 changed)
OCL=23104
CL=23108
parent b74e3b95
...@@ -455,13 +455,13 @@ definetypesigs(void) ...@@ -455,13 +455,13 @@ definetypesigs(void)
n = 0; n = 0;
for(i=0; i<NHASH; i++) for(i=0; i<NHASH; i++)
for(x = hash[i]; x; x=x->link) for(x = hash[i]; x; x=x->link)
if(memcmp(x->name, "sigt·", 6) == 0) if(memcmp(x->name, "sigt·", 6) == 0 && x->type != Sxxx)
n++; n++;
all = mal(n*sizeof all[0]); all = mal(n*sizeof all[0]);
j = 0; j = 0;
for(i=0; i<NHASH; i++) for(i=0; i<NHASH; i++)
for(x = hash[i]; x; x=x->link) for(x = hash[i]; x; x=x->link)
if(memcmp(x->name, "sigt·", 6) == 0) if(memcmp(x->name, "sigt·", 6) == 0 && x->type != Sxxx)
all[j++] = x; all[j++] = x;
// sort them by name // sort them by name
...@@ -488,5 +488,4 @@ definetypesigs(void) ...@@ -488,5 +488,4 @@ definetypesigs(void)
if(debug['v']) if(debug['v'])
Bprint(&bso, "%5.2f typesigs %d\n", cputime(), n); Bprint(&bso, "%5.2f typesigs %d\n", cputime(), n);
} }
...@@ -1063,8 +1063,11 @@ loop: ...@@ -1063,8 +1063,11 @@ loop:
// If we've seen an AGLOBL that said this sym was DUPOK, // If we've seen an AGLOBL that said this sym was DUPOK,
// ignore any more ADATA we see, which must be // ignore any more ADATA we see, which must be
// redefinitions. // redefinitions.
if(p->from.sym != S && p->from.sym->dupok) if(p->from.sym != S && p->from.sym->dupok) {
if(debug['v'])
Bprint(&bso, "skipping %s in %s: dupok", p->from.sym->name, pn);
goto loop; goto loop;
}
if(edatap == P) if(edatap == P)
datap = p; datap = p;
else else
...@@ -1083,7 +1086,7 @@ loop: ...@@ -1083,7 +1086,7 @@ loop:
if(ntext++ == 0 && s->type != 0 && s->type != SXREF) { if(ntext++ == 0 && s->type != 0 && s->type != SXREF) {
/* redefinition, so file has probably been seen before */ /* redefinition, so file has probably been seen before */
if(debug['v']) if(debug['v'])
diag("skipping: %s: redefinition: %s", pn, s->name); Bprint(&bso, "skipping: %s: redefinition: %s", pn, s->name);
return; return;
} }
if(curtext != P) { if(curtext != P) {
...@@ -1260,6 +1263,8 @@ lookup(char *symb, int v) ...@@ -1260,6 +1263,8 @@ lookup(char *symb, int v)
return s; return s;
s = mal(sizeof(*s)); s = mal(sizeof(*s));
if(debug['v'] > 1)
Bprint(&bso, "lookup %s\n", symb);
s->name = malloc(l + 1); s->name = malloc(l + 1);
memmove(s->name, symb, l); memmove(s->name, symb, l);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment