diff options
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2wasm.cpp')
-rw-r--r-- | llvm/tools/yaml2obj/yaml2wasm.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/yaml2obj/yaml2wasm.cpp b/llvm/tools/yaml2obj/yaml2wasm.cpp index 3eae8727b60..792f7c108bc 100644 --- a/llvm/tools/yaml2obj/yaml2wasm.cpp +++ b/llvm/tools/yaml2obj/yaml2wasm.cpp @@ -162,6 +162,17 @@ int WasmWriter::writeSectionContent(raw_ostream &OS, WasmYAML::LinkingSection &S } SubSection.Done(); } + + // INIT_FUNCS subsection + if (Section.InitFunctions.size()) { + encodeULEB128(wasm::WASM_INIT_FUNCS, OS); + encodeULEB128(Section.InitFunctions.size(), SubSection.GetStream()); + for (const WasmYAML::InitFunction &Func : Section.InitFunctions) { + encodeULEB128(Func.Priority, SubSection.GetStream()); + encodeULEB128(Func.FunctionIndex, SubSection.GetStream()); + } + SubSection.Done(); + } return 0; } |