[PATCH] D64602: [WebAssembly] Assembler: recognize .init_array as data section.
Wouter van Oortmerssen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 11:37:37 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366104: [WebAssembly] Assembler: recognize .init_array as data section. (authored by aardappel, committed by ).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64602/new/
https://reviews.llvm.org/D64602
Files:
llvm/trunk/lib/MC/MCParser/WasmAsmParser.cpp
llvm/trunk/test/MC/WebAssembly/basic-assembly.s
Index: llvm/trunk/test/MC/WebAssembly/basic-assembly.s
===================================================================
--- llvm/trunk/test/MC/WebAssembly/basic-assembly.s
+++ llvm/trunk/test/MC/WebAssembly/basic-assembly.s
@@ -101,6 +101,10 @@
.int32 2000000000
.size .L.str, 28
+ .section .init_array.42,"",@
+ .p2align 2
+ .int32 test0
+
.ident "clang version 9.0.0 (trunk 364502) (llvm/trunk 364571)"
.globaltype __stack_pointer, i32
@@ -190,8 +194,13 @@
# CHECK-NEXT: .L.str:
# CHECK-NEXT: .int8 72
# CHECK-NEXT: .asciz "ello, World!"
-# CHECK-NEXT: .int16 1234
-# CHECK-NEXT: .int64 5000000000
-# CHECK-NEXT: .int32 2000000000
+# CHECK-NEXT: .int16 1234
+# CHECK-NEXT: .int64 5000000000
+# CHECK-NEXT: .int32 2000000000
+# CHECK-NEXT: .size .L.str, 28
+
+# CHECK: .section .init_array.42,"",@
+# CHECK-NEXT: .p2align 2
+# CHECK-NEXT: .int32 test0
# CHECK: .globaltype __stack_pointer, i32
Index: llvm/trunk/lib/MC/MCParser/WasmAsmParser.cpp
===================================================================
--- llvm/trunk/lib/MC/MCParser/WasmAsmParser.cpp
+++ llvm/trunk/lib/MC/MCParser/WasmAsmParser.cpp
@@ -120,6 +120,9 @@
.StartsWith(".text", SectionKind::getText())
.StartsWith(".custom_section", SectionKind::getMetadata())
.StartsWith(".bss", SectionKind::getBSS())
+ // See use of .init_array in WasmObjectWriter and
+ // TargetLoweringObjectFileWasm
+ .StartsWith(".init_array", SectionKind::getData())
.Default(Optional<SectionKind>());
if (!Kind.hasValue())
return Parser->Error(Lexer->getLoc(), "unknown section kind: " + Name);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64602.209924.patch
Type: text/x-patch
Size: 1907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190715/857888c3/attachment.bin>
More information about the llvm-commits
mailing list