]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/8l/pass.c
pc, pc64: disable all pci devices for /dev/reboot
[plan9front.git] / sys / src / cmd / 8l / pass.c
old mode 100755 (executable)
new mode 100644 (file)
index fa9d0f7..297ccdf
@@ -217,7 +217,7 @@ loop:
        if(a != ACALL) {
                q = brchain(p->link);
                if(q != P && q->mark)
-               if(a != ALOOP) {
+               if(a != ALOOP && a != ATEXT) {
                        p->as = relinv(a);
                        p->link = p->pcond;
                        p->pcond = q;
@@ -311,7 +311,7 @@ patch(void)
                                switch(s->type) {
                                default:
                                        /* diag prints TNAME first */
-                                       diag("%s is undefined", s->name);
+                                       diag("undefined: %s", s->name);
                                        s->type = STEXT;
                                        s->value = vexit;
                                        break;  /* or fall through to set offset? */
@@ -492,8 +492,10 @@ dostkoff(void)
                if(p->as == ATEXT) {
                        curtext = p;
                        autoffset = p->to.offset;
-                       if(autoffset < 0)
+                       if(autoffset < 0) {
                                autoffset = 0;
+                               p->to.offset = 0;
+                       }
                        if(autoffset) {
                                p = appendp(p);
                                p->as = AADJSP;
@@ -678,14 +680,14 @@ export(void)
        n = 0;
        for(i = 0; i < NHASH; i++)
                for(s = hash[i]; s != S; s = s->link)
-                       if(s->sig != 0 && s->type != SXREF && s->type != SUNDEF && (nexports == 0 || s->subtype == SEXPORT))
+                       if(s->type != SXREF && s->type != SUNDEF && (nexports == 0 && s->sig != 0 || s->subtype == SEXPORT || allexport))
                                n++;
        esyms = malloc(n*sizeof(Sym*));
        ne = n;
        n = 0;
        for(i = 0; i < NHASH; i++)
                for(s = hash[i]; s != S; s = s->link)
-                       if(s->sig != 0 && s->type != SXREF && s->type != SUNDEF && (nexports == 0 || s->subtype == SEXPORT))
+                       if(s->type != SXREF && s->type != SUNDEF && (nexports == 0 && s->sig != 0 || s->subtype == SEXPORT || allexport))
                                esyms[n++] = s;
        for(i = 0; i < ne-1; i++)
                for(j = i+1; j < ne; j++)