diff options
| author | Russ Cox <rsc@golang.org> | 2015-01-29 20:19:07 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-02-03 18:23:05 +0000 |
| commit | 2e5b065ac24912be82e7082eeb136afd18d9734b (patch) | |
| tree | 9658f6b04dda8a9dd921bad95b2ca5adceb90f9b /include | |
| parent | 3ac37c72ae56a229bdc75986a4071b29bd7298c8 (diff) | |
| download | go-2e5b065ac24912be82e7082eeb136afd18d9734b.tar.xz | |
liblink: define fixed A-numbers for common instructions
This makes names like ANOP, ATEXT, AGLOBL, ACALL, AJMP, ARET
available for use by architecture-independent processing passes.
On arm and ppc64, the alternate names are now aliases for the
official ones (ABL for ACALL, AB or ABR for AJMP, ARETURN for ARET).
Change-Id: Id027771243795af2b3745199c645b6e1bedd7d18
Reviewed-on: https://go-review.googlesource.com/3577
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/link.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/include/link.h b/include/link.h index 481ea9fbb4..d210e06e55 100644 --- a/include/link.h +++ b/include/link.h @@ -249,6 +249,35 @@ struct Prog extern Prog zprog; // zeroed Prog +// Prog.as opcodes. +// These are the portable opcodes, common to all architectures. +// Each architecture defines many more arch-specific opcodes, +// with values starting at A_ARCHSPECIFIC. +enum { + AXXX = 0, + + ACALL, + ACHECKNIL, + ADATA, + ADUFFCOPY, + ADUFFZERO, + AEND, + AFUNCDATA, + AGLOBL, + AJMP, + ANOP, + APCDATA, + ARET, + ATEXT, + ATYPE, + AUNDEF, + AUSEFIELD, + AVARDEF, + AVARKILL, + + A_ARCHSPECIFIC, // first architecture-specific opcode value +}; + // prevent incompatible type signatures between liblink and 8l on Plan 9 #pragma incomplete struct Section @@ -599,26 +628,11 @@ struct LinkArch void (*preprocess)(Link*, LSym*); void (*assemble)(Link*, LSym*); void (*follow)(Link*, LSym*); - int (*iscall)(Prog*); - int (*isdata)(Prog*); void (*progedit)(Link*, Prog*); int minlc; int ptrsize; int regsize; - - int ACALL; - int ADATA; - int AEND; - int AFUNCDATA; - int AGLOBL; - int AJMP; - int ANOP; - int APCDATA; - int ARET; - int ATEXT; - int ATYPE; - int AUSEFIELD; }; /* executable header types */ |
