Constant wasmtime_environ::obj::ELF_NAME_DATA

source ·
pub const ELF_NAME_DATA: &'static str = ".name.wasm";
Expand description

This is the name of the section in the final ELF image which contains a concatenated list of all function names.

This section is optionally included in the final artifact depending on whether the wasm module has any name data at all (or in the future if we add an option to not preserve name data). This section is a concatenated list of strings where CompiledModuleInfo::func_names stores offsets/lengths into this section.

Note that the goal of this section is to avoid having to decode names at module-load time if we can. Names are typically only used for debugging or things like backtraces so there’s no need to eagerly load all of them. By storing the data in a separate section the hope is that the data, which is sometimes quite large (3MB seen for spidermonkey-compiled-to-wasm), can be paged in lazily from an mmap and is never paged in if we never reference it.