diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-08-10 12:28:48 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2021-03-02 10:00:08 +0100 |
commit | 83c210834197b7ad3208214a4f9d8669134c4a3c (patch) | |
tree | 82b5e49cf07c1f4453819ad9a317480d0cddc328 /gas.c | |
parent | cdee1d81c4c73113eb293bf2ac816bee53047f36 (diff) | |
download | roux-83c210834197b7ad3208214a4f9d8669134c4a3c.tar.gz |
add data $name = section "section" ...
This allows you to explicitly specify the section to emit the data directive for, allowing for sections other than .data: for example, .bss or .init_array.
Diffstat (limited to 'gas.c')
-rw-r--r-- | gas.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gas.c b/gas.c index 339154e..f8f4051 100644 --- a/gas.c +++ b/gas.c @@ -19,7 +19,11 @@ gasemitdat(Dat *d, FILE *f) switch (d->type) { case DStart: align = 0; - fprintf(f, ".data\n"); + if (d->u.str) { + fprintf(f, ".section %s\n", d->u.str); + } else { + fprintf(f, ".data\n"); + } break; case DEnd: break; |