[PATCH] D92323: [WebAssembly][MC] Fix placement of table section
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 1 01:06:23 PST 2020
sbc100 added inline comments.
================
Comment at: llvm/lib/MC/WasmObjectWriter.cpp:1814
writeFunctionSection(Functions);
+ writeTableSection(Tables);
// Skip the "memory" section; we import the memory instead.
----------------
wingo wrote:
> sbc100 wrote:
> > I don't understand how moving the table section before Events and Globals relates to being able to use externref and funcref as block types.
> >
> > Aren't all types defined in the type section? And also.. the blocks themselves are all defined in Code section which is after all of these isn't it?
> They are only related in the sense that they were just two small things that I needed to fix to assemble and link https://github.com/Igalia/ref-cpp/blob/master/milestones/m3/test.S.
>
> Regarding this specific block, the table section must go after functions and before events. The existing tests only validated before because the tests didn't include events or globals. Once you start linking things with globals, you run into validation problems, both in wasm-ld when it parses object files, and in external tools.
Wait.. are you saying that any llvm-produced object file today that contains even one global or event will not validate?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92323/new/
https://reviews.llvm.org/D92323
More information about the llvm-commits
mailing list