summary refs log tree commit diff
path: root/gas.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-05-15 17:29:51 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2019-05-16 21:10:39 +0200
commitacc3af47330fd6610cf0fbdb28e9fbd05160888f (patch)
treea492249a7d031512d2d9f632704e3ab37b37b2ae /gas.c
parent7837770ba1018d8c3320a9eaf29920ef53ba2791 (diff)
downloadroux-acc3af47330fd6610cf0fbdb28e9fbd05160888f.tar.gz
Fix a few uses of gassym missed in 9e7e5bff
Diffstat (limited to 'gas.c')
-rw-r--r--gas.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gas.c b/gas.c
index 2a24ab2..227c297 100644
--- a/gas.c
+++ b/gas.c
@@ -14,6 +14,7 @@ gasemitdat(Dat *d, FILE *f)
 		[DW] = "\t.int",
 		[DL] = "\t.quad"
 	};
+	char *p;
 
 	switch (d->type) {
 	case DStart:
@@ -25,9 +26,10 @@ gasemitdat(Dat *d, FILE *f)
 	case DName:
 		if (!align)
 			fprintf(f, ".balign 8\n");
+		p = d->u.str[0] == '"' ? "" : gassym;
 		if (d->export)
-			fprintf(f, ".globl %s%s\n", gassym, d->u.str);
-		fprintf(f, "%s%s:\n", gassym, d->u.str);
+			fprintf(f, ".globl %s%s\n", p, d->u.str);
+		fprintf(f, "%s%s:\n", p, d->u.str);
 		break;
 	case DZ:
 		fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num);
@@ -42,8 +44,9 @@ gasemitdat(Dat *d, FILE *f)
 			fprintf(f, "\t.ascii %s\n", d->u.str);
 		}
 		else if (d->isref) {
+			p = d->u.ref.nam[0] == '"' ? "" : gassym;
 			fprintf(f, "%s %s%s%+"PRId64"\n",
-				dtoa[d->type], gassym, d->u.ref.nam,
+				dtoa[d->type], p, d->u.ref.nam,
 				d->u.ref.off);
 		}
 		else {