ref: 0fb976c84f8eb424017c6ab6215a8e39cf14f727
parent: ea0f777ff662372425ab7ac2ff125ca3c7070cf6
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Jun 25 09:17:01 EDT 2015
Fix up extern type descs.
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -522,8 +522,8 @@
return;
if (b->lbl) {
if (b->isglobl)
- fprintf(fd, ".globl %s%s\n", Symprefix, b->lbl);
- fprintf(fd, "%s%s:\n", Symprefix, b->lbl);
+ fprintf(fd, ".globl %s%sg\n", Symprefix, b->lbl);
+ fprintf(fd, "%s%s%s:\n", Symprefix, b->lbl, b->isglobl ? "g" : "");
}
switch (b->type) {
case Bti8:
@@ -542,7 +542,7 @@
encodemin(fd, b->ival);
break;
case Btref:
- fprintf(fd, "\t.quad %s\n", b->ref.str);
+ fprintf(fd, "\t.quad %s%s\n", b->ref.str, b->ref.isextern ? "g" : "");
break;
case Btbytes:
writebytes(fd, b->bytes.buf, b->bytes.len);
--- a/6/typeinfo.c
+++ b/6/typeinfo.c
@@ -220,7 +220,7 @@
case Tyname:
i = snprintf(buf, sizeof buf, "%s", Symprefix);
tydescid(buf + i, sizeof buf - i, ty);
- lappend(&sub, &nsub, mkblobref(buf, ty->isimport));
+ lappend(&sub, &nsub, mkblobref(buf, ty->isimport || ty->vis == Visexport));
break;
}
b = mkblobseq(sub, nsub);