Commit a0a965fb authored by Kai Backman's avatar Kai Backman

fixing width bug in DATA output. some logging to make fixing

similar issues easier in the future.

R=rsc
APPROVED=rsc
DELTA=6  (1 added, 0 deleted, 5 changed)
OCL=34771
CL=34773
parent 6b0bd43f
...@@ -427,9 +427,10 @@ datagostring(Strlit *sval, Addr *a) ...@@ -427,9 +427,10 @@ datagostring(Strlit *sval, Addr *a)
// $string len+ptr // $string len+ptr
datastring(sval->s, sval->len, &ap); datastring(sval->s, sval->len, &ap);
ap.name = ap.type;
ap.type = D_CONST; ap.type = D_CONST;
ap.etype = TINT32; ap.etype = TINT32;
wi = types[TUINT32]->width; wi = types[TUINT32]->width;
wp = types[tptr]->width; wp = types[tptr]->width;
...@@ -470,7 +471,7 @@ datagostring(Strlit *sval, Addr *a) ...@@ -470,7 +471,7 @@ datagostring(Strlit *sval, Addr *a)
p->to.offset = sval->len; p->to.offset = sval->len;
p = pc; p = pc;
ggloblsym(ao.sym, types[TSTRING]->width, ao.type == D_EXTERN); ggloblsym(ao.sym, types[TSTRING]->width, ao.name == D_EXTERN);
if(ao.name == D_STATIC) if(ao.name == D_STATIC)
p->from.name = D_STATIC; p->from.name = D_STATIC;
text(); text();
...@@ -549,7 +550,7 @@ dgostrlitptr(Sym *s, int off, Strlit *lit) ...@@ -549,7 +550,7 @@ dgostrlitptr(Sym *s, int off, Strlit *lit)
p->from.name = D_EXTERN; p->from.name = D_EXTERN;
p->from.sym = s; p->from.sym = s;
p->from.offset = off; p->from.offset = off;
p->from.reg = widthptr; p->reg = widthptr;
datagostring(lit, &p->to); datagostring(lit, &p->to);
p->to.type = D_CONST; p->to.type = D_CONST;
p->to.etype = TINT32; p->to.etype = TINT32;
......
...@@ -52,8 +52,8 @@ dodata(void) ...@@ -52,8 +52,8 @@ dodata(void)
s->type, s->name, p); s->type, s->name, p);
v = p->from.offset + p->reg; v = p->from.offset + p->reg;
if(v > s->value) if(v > s->value)
diag("initialize bounds (%ld): %s\n%P", diag("initialize bounds (%ld/%ld): %s\n%P",
s->value, s->name, p); v, s->value, s->name, p);
if((s->type == SBSS || s->type == SDATA) && (p->to.type == D_CONST || p->to.type == D_OCONST) && (p->to.name == D_EXTERN || p->to.name == D_STATIC)){ if((s->type == SBSS || s->type == SDATA) && (p->to.type == D_CONST || p->to.type == D_OCONST) && (p->to.name == D_EXTERN || p->to.name == D_STATIC)){
s = p->to.sym; s = p->to.sym;
if(s != S && (s->type == STEXT || s->type == SLEAF || s->type == SCONST || s->type == SXREF)) if(s != S && (s->type == STEXT || s->type == SLEAF || s->type == SCONST || s->type == SXREF))
......
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