Module elf

Module elf 

Source
Expand description

Helpers shared by the object-based compiler backends (Cranelift and Singlepass) for emitting per-function relocatable ELF objects and linking them into the final module image.

Enums§

CompileOutput
The result of compiling a single unit (function or trampoline): either an in-memory body for the classic artifact format, or a relocatable object file on disk for the ELF artifact format (together with the maximum stack usage, when known).

Functions§

add_libcall_symbol
Declare an undefined dynamic symbol for a libcall, resolved by the runtime loader through a dynamic relocation.
add_relocations
Apply the compiled code’s relocations to section, declaring the referenced symbols.
add_undefined_symbol
Declare an undefined text symbol resolved when the objects are linked.
compile_output_in_memory
Extract the in-memory bodies from classic-mode compile outputs.
compile_output_paths
Extract the object-file paths from ELF-mode compile outputs.
emit_eh_frame_section
Emit a serialized .eh_frame blob into its own section, resolving the recorded relocations against the function’s text symbol, the exception personality routine and the function’s LSDA section.
emit_function_body
Serialize a trampoline’s body into its own relocatable object file.
emit_import_trampoline
Serialize an import trampoline’s custom section into its own relocatable object file.
emit_trap_section
Emit the per-function trap table into a .w.traps section, under a weak data symbol so the metadata object can reference it per function.
link_module
Link all the per-function and trampoline objects (plus the Wasmer metadata object) into the final shared-object module image.
relocation_kind_to_flags
Map a Wasmer relocation kind onto the corresponding object-file relocation flags.
save_object
Write a finished object into build_directory under filename.