From 2e5b065ac24912be82e7082eeb136afd18d9734b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 29 Jan 2015 20:19:07 -0500 Subject: liblink: define fixed A-numbers for common instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Austin Clements --- src/liblink/objfile.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/liblink/objfile.c') diff --git a/src/liblink/objfile.c b/src/liblink/objfile.c index 79a88db0bf..c01160af7e 100644 --- a/src/liblink/objfile.c +++ b/src/liblink/objfile.c @@ -147,10 +147,10 @@ writeobj(Link *ctxt, Biobuf *b) plink = p->link; p->link = nil; - if(p->as == ctxt->arch->AEND) + if(p->as == AEND) continue; - if(p->as == ctxt->arch->ATYPE) { + if(p->as == ATYPE) { // Assume each TYPE instruction describes // a different local variable or parameter, // so no dedup. @@ -174,7 +174,7 @@ writeobj(Link *ctxt, Biobuf *b) continue; } - if(p->as == ctxt->arch->AGLOBL) { + if(p->as == AGLOBL) { s = p->from.sym; if(s->seenglobl++) print("duplicate %P\n", p); @@ -200,12 +200,12 @@ writeobj(Link *ctxt, Biobuf *b) continue; } - if(p->as == ctxt->arch->ADATA) { + if(p->as == ADATA) { savedata(ctxt, p->from.sym, p, ""); continue; } - if(p->as == ctxt->arch->ATEXT) { + if(p->as == ATEXT) { s = p->from.sym; if(s == nil) { // func _() { } @@ -235,7 +235,7 @@ writeobj(Link *ctxt, Biobuf *b) continue; } - if(p->as == ctxt->arch->AFUNCDATA) { + if(p->as == AFUNCDATA) { // Rewrite reference to go_args_stackmap(SB) to the Go-provided declaration information. if(curtext == nil) // func _() {} continue; @@ -260,14 +260,14 @@ writeobj(Link *ctxt, Biobuf *b) continue; found = 0; for(p = s->text; p != nil; p = p->link) { - if(p->as == ctxt->arch->AFUNCDATA && p->from.type == TYPE_CONST && p->from.offset == FUNCDATA_ArgsPointerMaps) { + if(p->as == AFUNCDATA && p->from.type == TYPE_CONST && p->from.offset == FUNCDATA_ArgsPointerMaps) { found = 1; break; } } if(!found) { p = appendp(ctxt, s->text); - p->as = ctxt->arch->AFUNCDATA; + p->as = AFUNCDATA; p->from.type = TYPE_CONST; p->from.offset = FUNCDATA_ArgsPointerMaps; p->to.type = TYPE_MEM; -- cgit v1.3-5-g9baa