diff options
author | Anthony Martin <ality@pbrane.org> | 2013-06-04 15:18:02 -0700 |
---|---|---|
committer | Anthony Martin <ality@pbrane.org> | 2013-06-04 15:18:02 -0700 |
commit | 367679d5140a75e0d7896d3a1482d252a700dd14 (patch) | |
tree | 24a57fca4956d0dd2b75b15bfc4b7640e985e126 /src/cmd/8c | |
parent | da6bbf92ca18ac1d37afd1277d90c7cbc5e2e73f (diff) | |
download | go-367679d5140a75e0d7896d3a1482d252a700dd14.tar.gz |
cmd/5c, cmd/6c, cmd/8c: isolate textflag and dataflag
Fixes issue 5419.
R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://codereview.appspot.com/9241044
Diffstat (limited to 'src/cmd/8c')
-rw-r--r-- | src/cmd/8c/txt.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cmd/8c/txt.c b/src/cmd/8c/txt.c index 1b7617bc5..7f9538795 100644 --- a/src/cmd/8c/txt.c +++ b/src/cmd/8c/txt.c @@ -146,9 +146,7 @@ gclean(void) continue; if(s->type == types[TENUM]) continue; - textflag = s->dataflag; gpseudo(AGLOBL, s, nodconst(s->type->width)); - textflag = 0; } nextpc(); p->as = AEND; @@ -1381,8 +1379,16 @@ gpseudo(int a, Sym *s, Node *n) p->as = a; p->from.type = D_EXTERN; p->from.sym = s; - p->from.scale = textflag; - textflag = 0; + + switch(a) { + case ATEXT: + p->from.scale = textflag; + textflag = 0; + break; + case AGLOBL: + p->from.scale = s->dataflag; + break; + } if(s->class == CSTATIC) p->from.type = D_STATIC; |