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§
- Compile
Output - 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_frameblob 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.trapssection, 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_directoryunderfilename.