diff options
| author | Russ Cox <rsc@golang.org> | 2015-01-29 14:58:54 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-02-03 18:22:15 +0000 |
| commit | 77a415e5a698e8f897aed8aa64db6855b8f952fc (patch) | |
| tree | a2adb923b983adfd5301f0d87c9c26949e22d9d6 /src/liblink/obj5.c | |
| parent | 72521319c733e5de62bb837508ea9fa2b1f3a0a2 (diff) | |
| download | go-77a415e5a698e8f897aed8aa64db6855b8f952fc.tar.xz | |
liblink: place TEXT/GLOBL flags in p->from3 always
Before, amd64 and 386 stored the flags in p->from.scale
and arm and ppc64 stored the flags in p->reg.
Both caused special cases in printing and in handling of the
addresses.
To avoid possible conflicts with the real meaning of p->from
and to avoid storing a non-register value in a reg field,
use from3 to hold a TYPE_CONST value giving the flags.
There is still a special case for printing, because the flags
are specified without a $, and normally a TYPE_CONST prints
with a $. But that's much less special than what came before.
This allows us to remove the textflag and settextflag methods
from LinkArch. They are no longer architecture-specific.
Change-Id: I931da8e1ecd92e127cd9aa44ef5a73c42e730110
Reviewed-on: https://go-review.googlesource.com/3572
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/liblink/obj5.c')
| -rw-r--r-- | src/liblink/obj5.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/liblink/obj5.c b/src/liblink/obj5.c index 0f2e9fa4f2..8d20173912 100644 --- a/src/liblink/obj5.c +++ b/src/liblink/obj5.c @@ -58,18 +58,6 @@ datasize(Prog *p) return p->reg; } -static int -textflag(Prog *p) -{ - return p->reg; -} - -static void -settextflag(Prog *p, int f) -{ - p->reg = f; -} - static void progedit(Link *ctxt, Prog *p) { @@ -268,7 +256,7 @@ preprocess(Link *ctxt, LSym *cursym) cursym->args = p->to.u.argsize; if(ctxt->debugzerostack) { - if(autoffset && !(p->reg&NOSPLIT)) { + if(autoffset && !(p->from3.offset&NOSPLIT)) { // MOVW $4(R13), R1 p = appendp(ctxt, p); p->as = AMOVW; @@ -421,8 +409,8 @@ preprocess(Link *ctxt, LSym *cursym) break; } - if(!(p->reg & NOSPLIT)) - p = stacksplit(ctxt, p, autosize, !(cursym->text->reg&NEEDCTXT)); // emit split check + if(!(p->from3.offset & NOSPLIT)) + p = stacksplit(ctxt, p, autosize, !(cursym->text->from3.offset&NEEDCTXT)); // emit split check // MOVW.W R14,$-autosize(SP) p = appendp(ctxt, p); @@ -435,7 +423,7 @@ preprocess(Link *ctxt, LSym *cursym) p->to.reg = REGSP; p->spadj = autosize; - if(cursym->text->reg & WRAPPER) { + if(cursym->text->from3.offset & WRAPPER) { // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame // // MOVW g_panic(g), R1 @@ -1048,8 +1036,6 @@ LinkArch linkarm = { .isdata = isdata, .prg = prg, .progedit = progedit, - .settextflag = settextflag, - .textflag = textflag, .minlc = 4, .ptrsize = 4, |
