* read.c (stringer): Treat space separated, quote enclosed strings
as a single string.
* doc/as.texi (asciz): Mention this behaviour in the description
of the asciz directive.
* testsuite/gas/all/asciz.s: New test.
* testsuite/gas/all/asciz.d: New test driver.
* testsuite/gas/all/gas.exp: Run the new test.
@cindex zero-terminated strings
@cindex null-terminated strings
@code{.asciz} is just like @code{.ascii}, but each string is followed by
-a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
+a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''. Note that
+multiple string arguments not separated by commas will be concatenated
+together and only one final zero byte will be stored.
@node Attach_to_group
@section @code{.attach_to_group @var{name}}
while (is_a_char (c = next_char_of_string ()))
stringer_append_char (c, bitsize);
+ /* Treat "a" "b" as "ab". Even if we are appending zeros. */
+ SKIP_ALL_WHITESPACE ();
+ if (*input_line_pointer == '"')
+ break;
+
if (append_zero)
stringer_append_char (0, bitsize);
--- /dev/null
+#objdump: -s -j .data -j "\$DATA\$"
+#name: Generation of NUL terminated strings
+# The TIC4x and TIC5x assemblers do not support the concatenation of space separated strings.
+#xfail: tic4*-* tic5*-*
+
+.*: +file format .*
+
+Contents of section (\.data|\$DATA\$):
+.*ab\.cd\..*
+#pass
--- /dev/null
+ .data
+ .asciz "a" "b", "c" "d"
gas_test "pr23938.s" "" "" ".xstabs"
run_dump_test "nop"
+run_dump_test "asciz"