diff options
author | Shenghou Ma <minux@golang.org> | 2014-08-06 00:24:43 -0400 |
---|---|---|
committer | Shenghou Ma <minux@golang.org> | 2014-08-06 00:24:43 -0400 |
commit | 1656adfa00c1afa1fc66d08225dbac165d1dac2d (patch) | |
tree | 833e0bc511b2697df599faa78c901e141c644056 /src/liblink | |
parent | f0cc3417f24bbf9e404bfa53bfce26a02daee797 (diff) | |
download | go-1656adfa00c1afa1fc66d08225dbac165d1dac2d.tar.gz |
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://codereview.appspot.com/119330043
Diffstat (limited to 'src/liblink')
-rw-r--r-- | src/liblink/objfile.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/liblink/objfile.c b/src/liblink/objfile.c index 610f87954..22c9199d5 100644 --- a/src/liblink/objfile.c +++ b/src/liblink/objfile.c @@ -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) |