1
0
mirror of https://github.com/golang/go synced 2024-11-23 17:00:07 -07:00

liblink: use LinkArch.textflag() to get text and dataflag

Rather than switch on thechar.

LGTM=rsc, dave
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/119330043
This commit is contained in:
Shenghou Ma 2014-08-06 00:24:43 -04:00
parent 61b1d3a719
commit 3c24b60fd3

View File

@ -183,12 +183,7 @@ writeobj(Link *ctxt, Biobuf *b)
s->size = p->to.offset;
if(s->type == 0 || s->type == SXREF)
s->type = SBSS;
if(ctxt->arch->thechar == '5')
flag = p->reg;
else
flag = p->from.scale;
flag = ctxt->arch->textflag(p);
if(flag & DUPOK)
s->dupok = 1;
if(flag & RODATA)
@ -221,10 +216,7 @@ writeobj(Link *ctxt, Biobuf *b)
else
etext->next = s;
etext = s;
if(ctxt->arch->thechar == '5')
flag = p->reg;
else
flag = p->from.scale;
flag = ctxt->arch->textflag(p);
if(flag & DUPOK)
s->dupok = 1;
if(flag & NOSPLIT)