1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[WebAssembly] Assembler: recognize .init_array as data section.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64602

llvm-svn: 366104
This commit is contained in:
Wouter van Oortmerssen 2019-07-15 18:36:07 +00:00
parent edcd258eb3
commit f4d8b2324c
2 changed files with 15 additions and 3 deletions

View File

@ -120,6 +120,9 @@ public:
.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);

View File

@ -101,6 +101,10 @@ test0:
.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
@ -193,5 +197,10 @@ test0:
# 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