commit cf7e007d9686327a5c4884b20e01034fa489cecf
parent 6eef84a8115e651e77d25dbe750ad7254804f351
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 27 Mar 2021 14:15:48 -0700
emit: update to upstream syntax for data section
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/emit.c b/src/emit.c
@@ -291,7 +291,8 @@ static void
emit_data(struct qbe_def *def, FILE *out)
{
assert(def->kind == Q_DATA);
- fprintf(out, "%sdata ", def->exported ? "export " : "");
+ fprintf(out, "%sdata $%s = ", def->exported ? "export " : "",
+ def->name);
if (def->data.section && def->data.secflags) {
fprintf(out, "section \"%s\" \"%s\" ",
def->data.section, def->data.secflags);
@@ -302,7 +303,7 @@ emit_data(struct qbe_def *def, FILE *out)
} else {
fprintf(out, "section \".data.%s\" ", def->name);
}
- fprintf(out, "$%s = { ", def->name);
+ fprintf(out, "{ ");
struct qbe_data_item *item = &def->data.items;
while (item) {