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 /include | |
| 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 'include')
| -rw-r--r-- | include/link.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/link.h b/include/link.h index 42071dbb35..a72c66d17e 100644 --- a/include/link.h +++ b/include/link.h @@ -210,7 +210,7 @@ struct Reloc }; // TODO(rsc): Describe prog. -// TOOD(rsc): Make ARM scond == 0 mean C_SCOND_NONE. +// TODO(rsc): Describe TEXT/GLOBL flag in from3, DATA width in from3. struct Prog { vlong pc; @@ -224,7 +224,7 @@ struct Prog int16 reg; // arm, ppc64 only (e.g., ADD from, reg, to); // starts at 0 for both GPRs and FPRs; // also used for ADATA width on arm, ppc64 - Addr from3; // ppc64 only (e.g., RLWM/FMADD from, reg, from3, to) + Addr from3; // addl source argument (e.g., RLWM/FMADD from, reg, from3, to) Addr to; // for 5g, 6g, 8g internal use @@ -245,8 +245,6 @@ struct Prog char width; /* fake for DATA */ char mode; /* 16, 32, or 64 in 6l, 8l; internal use in 5g, 6g, 8g */ - - /*c2go uchar TEXTFLAG; */ }; // prevent incompatible type signatures between liblink and 8l on Plan 9 @@ -604,8 +602,6 @@ struct LinkArch int (*isdata)(Prog*); Prog* (*prg)(void); void (*progedit)(Link*, Prog*); - void (*settextflag)(Prog*, int); - int (*textflag)(Prog*); int minlc; int ptrsize; |
