[all-commits] [llvm/llvm-project] 5a082d: [WebAssembly][Object] Remove requirement that obje...
Derek Schuff via All-commits
all-commits at lists.llvm.org
Thu Jun 23 13:56:35 PDT 2022
Author: Derek Schuff <dschuff at chromium.org>
Date: 2022-06-23 (Thu, 23 Jun 2022)
[WebAssembly][Object] Remove requirement that objects must have code sections
When parsing name and linking sections, we currently require that the object
must have a code section (it seems that this was intended to verify section
ordering). However it can be useful for binaries to have their code sections
stripped out (e.g. if we just want the debug info). In that case we need
the rest of the known sections (so e.g. we know how many functions there
are, to verify the name section) but not the actual code.
I've removed the restriction completely. I think this is OK because the
section-parsing code already checks function and global indices in many
places for validity and will return appropriate errors if the relevant sections
are missing. Also we can't just replace the requirement of seeing a code section
with a requirement that we see a function or global section, because a binary
may just not have any functions or globals.
But there's only an problem if the name or linking section tries to name a
Part of a fix for https://github.com/emscripten-core/emscripten/issues/13084
Differential Revision: https://reviews.llvm.org/D128094
More information about the All-commits