]> Cypherpunks repositories - gostls13.git/commitdiff
liblink: fix extern register accesses on Plan 9 (386)
authorAnthony Martin <ality@pbrane.org>
Mon, 9 Dec 2013 23:48:44 +0000 (18:48 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 9 Dec 2013 23:48:44 +0000 (18:48 -0500)
R=golang-dev, 0intro, rsc
CC=golang-dev
https://golang.org/cl/39680044

src/liblink/obj8.c

index e744abe55ee344e4efb631d8d5eb0ec3bf929528..e22a1b912f3bce8aa7b4a46dfe0e7c860b5ddde4 100644 (file)
@@ -271,10 +271,11 @@ progedit(Link *ctxt, Prog *p)
                        }
                }
        }
-       /* TODO 
        if(ctxt->headtype == Hplan9) {
                if(p->from.type == D_INDIR+D_GS
                && p->to.type >= D_AX && p->to.type <= D_DI) {
+                       if(ctxt->plan9tos == nil)
+                               ctxt->plan9tos = linklookup(ctxt, "_tos", 0);
                        q = appendp(ctxt, p);
                        q->from = p->from;
                        q->from.type = D_INDIR + p->to.type;
@@ -282,11 +283,10 @@ progedit(Link *ctxt, Prog *p)
                        q->as = p->as;
                        p->as = AMOVL;
                        p->from.type = D_EXTERN;
-                       p->from.sym = plan9_tos;
+                       p->from.sym = ctxt->plan9tos;
                        p->from.offset = 0;
                }
        }
-       */
 }
 
 static Prog*