[PATCH] D91460: [AsmParser] make .ascii/.asciz/.string support multiple strings
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 14 02:58:55 PST 2020
nickdesaulniers added a comment.
In D91460#2395521 <https://reviews.llvm.org/D91460#2395521>, @jcai19 wrote:
>> In which case I assume `.asciz "foo" "bar"` is equivalent to `.asciz "foobar"` rather than `.asciz "foo\0bar"` (same for `.string`), just like C string concatenation, and hence why both syntaxes exist?
>
> I think GNU assembler would produce the same disassembly with `.asciz "foo" "bar"` and `.asciz "foo", "bar"`.
>
> $ cat test.s
> .asciz "foo" "bar"
> .asciz "foo", "bar"
>
> $ arm-linux-gnueabihf-gcc test.s -c -o test.o
> $ arm-linux-gnueabihf-objdump -dr test.o
> gcc.o: file format elf32-littlearm
>
>
> Disassembly of section .text:
>
> 00000000 <.text>:
> 0: 006f6f66 .word 0x006f6f66
> 4: 00726162 .word 0x00726162
> 8: 006f6f66 .word 0x006f6f66
> c: 00726162 .word 0x00726162
https://github.com/ClangBuiltLinux/linux/blob/f01c30de86f1047e9bae1b1b1417b0ce8dcd15b1/arch/arm/probes/kprobes/test-core.h#L114-L116 makes it sounds like `.ascii` and `.asciz` work differently in this regard?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91460/new/
https://reviews.llvm.org/D91460
More information about the llvm-commits
mailing list