diff options
author | Michael Forney <mforney@mforney.org> | 2019-05-15 17:29:51 -0700 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2019-05-16 21:10:39 +0200 |
commit | acc3af47330fd6610cf0fbdb28e9fbd05160888f (patch) | |
tree | a492249a7d031512d2d9f632704e3ab37b37b2ae | |
parent | 7837770ba1018d8c3320a9eaf29920ef53ba2791 (diff) | |
download | roux-acc3af47330fd6610cf0fbdb28e9fbd05160888f.tar.gz |
Fix a few uses of gassym missed in 9e7e5bff
-rw-r--r-- | gas.c | 9 |
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 { |