Description
I'd like to propose that we move towards using multple data and code sections in the object format.
This matches llvm's internal ideas about what a section is. Today if you iterate through section in an object you will only see a single code section, even though we default -ffunction-section
. This mean the linker is forced then break down the monolithic code and section sections in sub-sections.
There are bugs popping up due to the fact that we dont currently map llvm's concept of a section onto a wasm section: https://reviews.llvm.org/D74531
There is a wasm proposal out of make repeated sections a valid thing: https://github.com/WebAssembly/conditional-sections.
The fact that we can currently validate wasm object files with tools like wasm-validate
is feature I don't want to loose, so such tools would need to learn about conditional sections (at at least the multi-section part of it) before we would want to enable this by default.