.ascii/.asciz: juxtaposition and comma

Andreas Schwab schwab@linux-m68k.org
Tue Nov 17 09:21:42 GMT 2020


On Nov 16 2020, Fangrui Song wrote:

> % cat a.s
> .asciz "a", "b" "c", "d"
> .ascii "e", "f" "g", "h"
> % as a.s -o a.o
> % readelf -x .text a.o
>
> Hex dump of section '.text':
>   0x00000000 61006200 63006400 65666768          a.b.c.d.efgh
>
> The behavior of .ascii is quite reasonable.
>
> For .asciz, when juxtaposition is used, it seems strange that "b" "c"
> actually results to b\0c\0 (C preprocessor just concatenates the string).

Both directives parse each whitespace or comma separated string as a
separate argument.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Binutils mailing list