Commit 8559e3ad authored by Rob Pike's avatar Rob Pike

diagnose missing symbols instead of

silently miscompiling.

R=rsc
OCL=22872
CL=22872
parent 2ab55776
...@@ -708,6 +708,8 @@ datblk(int32 s, int32 n) ...@@ -708,6 +708,8 @@ datblk(int32 s, int32 n)
if(p->to.sym) { if(p->to.sym) {
if(p->to.sym->type == SUNDEF) if(p->to.sym->type == SUNDEF)
ckoff(p->to.sym, o); ckoff(p->to.sym, o);
if(p->to.sym->type == Sxxx)
diag("missing symbol %s", p->to.sym->name);
o += p->to.sym->value; o += p->to.sym->value;
if(p->to.sym->type != STEXT && p->to.sym->type != SUNDEF) if(p->to.sym->type != STEXT && p->to.sym->type != SUNDEF)
o += INITDAT; o += INITDAT;
......
...@@ -487,6 +487,6 @@ definetypesigs(void) ...@@ -487,6 +487,6 @@ definetypesigs(void)
prog->to.offset = n; prog->to.offset = n;
if(debug['v']) if(debug['v'])
Bprint(&bso, "%5.2f typestrings %d\n", cputime(), n); Bprint(&bso, "%5.2f typesigs %d\n", cputime(), n);
} }
...@@ -137,6 +137,7 @@ struct Movtab ...@@ -137,6 +137,7 @@ struct Movtab
enum enum
{ {
Sxxx,
STEXT = 1, STEXT = 1,
SDATA, SDATA,
SBSS, SBSS,
......
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