MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / append_bti

Method append_bti

crates/wasmtime/src/engine.rs:732–747  ·  view source on GitHub ↗
(&self, obj: &mut Object<'_>)

Source from the content-addressed store, hash-verified

730
731 #[cfg(any(feature = "cranelift", feature = "winch"))]
732 pub(crate) fn append_bti(&self, obj: &mut Object<'_>) {
733 let section = obj.add_section(
734 obj.segment_name(StandardSegment::Data).to_vec(),
735 wasmtime_environ::obj::ELF_WASM_BTI.as_bytes().to_vec(),
736 object::SectionKind::ReadOnlyData,
737 );
738 let contents = if self
739 .compiler()
740 .is_some_and(|c| c.is_branch_protection_enabled())
741 {
742 1
743 } else {
744 0
745 };
746 obj.append_section_data(section, &[contents], 1);
747 }
748}
749
750/// Return value from the [`Engine::detect_precompiled`] API.

Callers 2

build_module_artifactsFunction · 0.80

Calls 4

as_bytesMethod · 0.80
to_vecMethod · 0.45
compilerMethod · 0.45

Tested by

no test coverage detected