.ascii/.asciz: juxtaposition and comma

Fangrui Song i@maskray.me
Tue Nov 17 05:07:30 GMT 2020


% 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).


More information about the Binutils mailing list