Commit 3c24b60f authored by Shenghou Ma's avatar Shenghou Ma

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
parent 61b1d3a7
......@@ -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)
......
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