summaryrefslogtreecommitdiff
path: root/flattree.c
diff options
context:
space:
mode:
author Rob Herring <robh@kernel.org> 2021-07-27 12:30:19 -0600
committer David Gibson <david@gibson.dropbear.id.au> 2021-09-25 16:11:41 +1000
commitff3a30c115ad7354689dc7858604356ecb7f9b1c (patch)
treebf9715256abd733baa9314d1a35a853df9255646 /flattree.c
parent5eb5927d81ee6036f45c4e1bd89ae66ed325d721 (diff)
asm: Use .asciz and .ascii instead of .string
We use the .string pseudo-op both in some of our test assembly files and in our -Oasm output. We expect this to emit a \0 terminated string into the .o file. However for certain targets (e.g. HP PA-RISC) it doesn't include the \0. Use .asciz instead, which explicitly does what we want. There's also one place we can use .ascii (which explicitly emits a string *without* \0 termination) instead of multiple .byte directives. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'flattree.c')
-rw-r--r--flattree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/flattree.c b/flattree.c
index 3d0204f..5254aeb 100644
--- a/flattree.c
+++ b/flattree.c
@@ -134,9 +134,9 @@ static void asm_emit_string(void *e, const char *str, int len)
FILE *f = e;
if (len != 0)
- fprintf(f, "\t.string\t\"%.*s\"\n", len, str);
+ fprintf(f, "\t.asciz\t\"%.*s\"\n", len, str);
else
- fprintf(f, "\t.string\t\"%s\"\n", str);
+ fprintf(f, "\t.asciz\t\"%s\"\n", str);
}
static void asm_emit_align(void *e, int a)
@@ -438,7 +438,7 @@ static void dump_stringtable_asm(FILE *f, struct data strbuf)
while (p < (strbuf.val + strbuf.len)) {
len = strlen(p);
- fprintf(f, "\t.string \"%s\"\n", p);
+ fprintf(f, "\t.asciz \"%s\"\n", p);
p += len+1;
}
}