shithub: mc

Download patch

ref: 0b0365bc107ae23e2b88335373bafdd1cb54e5a2
parent: 4531e7d7f72c2171fdac5c1914ebaf867db61187
author: Ori Bernstein <[email protected]>
date: Wed Dec 24 09:10:07 EST 2014

We now seem to buidl on plan9.

    Need to revisit privateness of symbols.

--- a/6/genp9.c
+++ b/6/genp9.c
@@ -90,10 +90,7 @@
         if (l->mem.constdisp)
             fprintf(fd, "%ld", l->mem.constdisp);
     } else if (l->mem.lbldisp) {
-        if (l->mem.base)
-            fprintf(fd, "$%s", l->mem.lbldisp);
-        else
-            fprintf(fd, "%s", l->mem.lbldisp);
+        fprintf(fd, "%s", l->mem.lbldisp);
     }
     if (!l->mem.base || l->mem.base->reg.colour == Rrip) {
         fprintf(fd, "+0(SB)");
@@ -245,10 +242,12 @@
 {
     size_t i, len;
 
+	if (sz == 0)
+		fprintf(fd, "DATA %s<>+%zd(SB)/0,$\"\"\n", name, off, sz);
     for (i = 0; i < sz; i++) {
         len = min(sz - i, 8);
         if (i % 8 == 0)
-            fprintf(fd, "DATA %s+%zd(SB)/%zd,$\"", name, off + i, len);
+            fprintf(fd, "DATA %s<>+%zd(SB)/%zd,$\"", name, off + i, len);
         if (p[i] == '"' || p[i] == '\\')
             fprintf(fd, "\\");
         if (isprint(p[i]))
@@ -426,7 +425,7 @@
     k = htkeys(strtab, &nk);
     for (i = 0; i < nk; i++) {
         s = k[i];
-		fprintf(fd, "GLOBL %s+0(SB),$%lld\n", htget(strtab, k[i]), (vlong)s->len);
+		fprintf(fd, "GLOBL %s<>+0(SB),$%lld\n", htget(strtab, k[i]), (vlong)s->len);
         writebytes(fd, htget(strtab, k[i]), 0, s->buf, s->len);
     }
 }