[ewasm] Support compiling data subobjects

This commit is contained in:
Alex Beregszaszi
2020-11-09 17:47:12 +00:00
parent e41700e5f7
commit 6e11754c8b
4 changed files with 19 additions and 1 deletions
+8
View File
@@ -315,6 +315,14 @@ bytes BinaryTransform::run(Module const& _module)
size_t const offset = ret.size() - length;
subModulePosAndSize[name] = {offset, length};
}
for (auto const& [name, data]: _module.customSections)
{
size_t const length = data.size();
ret += customSection(name, data);
// Skip all the previous sections and the size field of this current custom section.
size_t const offset = ret.size() - length;
subModulePosAndSize[name] = {offset, length};
}
BinaryTransform bt(
move(globalIDs),