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