(&self, obj: &mut Object<'_>)
| 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. |
no test coverage detected