mirror of
https://github.com/golang/go
synced 2024-11-26 00:57:56 -07:00
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
This commit is contained in:
parent
6b0bd43fe4
commit
a0a965fbcf
@ -427,9 +427,10 @@ datagostring(Strlit *sval, Addr *a)
|
||||
|
||||
// $string len+ptr
|
||||
datastring(sval->s, sval->len, &ap);
|
||||
|
||||
ap.name = ap.type;
|
||||
ap.type = D_CONST;
|
||||
ap.etype = TINT32;
|
||||
|
||||
wi = types[TUINT32]->width;
|
||||
wp = types[tptr]->width;
|
||||
|
||||
@ -470,7 +471,7 @@ datagostring(Strlit *sval, Addr *a)
|
||||
p->to.offset = sval->len;
|
||||
|
||||
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)
|
||||
p->from.name = D_STATIC;
|
||||
text();
|
||||
@ -549,7 +550,7 @@ dgostrlitptr(Sym *s, int off, Strlit *lit)
|
||||
p->from.name = D_EXTERN;
|
||||
p->from.sym = s;
|
||||
p->from.offset = off;
|
||||
p->from.reg = widthptr;
|
||||
p->reg = widthptr;
|
||||
datagostring(lit, &p->to);
|
||||
p->to.type = D_CONST;
|
||||
p->to.etype = TINT32;
|
||||
|
@ -52,8 +52,8 @@ dodata(void)
|
||||
s->type, s->name, p);
|
||||
v = p->from.offset + p->reg;
|
||||
if(v > s->value)
|
||||
diag("initialize bounds (%ld): %s\n%P",
|
||||
s->value, s->name, p);
|
||||
diag("initialize bounds (%ld/%ld): %s\n%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)){
|
||||
s = p->to.sym;
|
||||
if(s != S && (s->type == STEXT || s->type == SLEAF || s->type == SCONST || s->type == SXREF))
|
||||
|
Loading…
Reference in New Issue
Block a user