(
obj: ElfFile64<'data, Endianness, R>,
)
| 149 | } |
| 150 | |
| 151 | fn detect_precompiled<'data, R: object::ReadRef<'data>>( |
| 152 | obj: ElfFile64<'data, Endianness, R>, |
| 153 | ) -> Option<Precompiled> { |
| 154 | match obj.flags() { |
| 155 | FileFlags::Elf { |
| 156 | os_abi: obj::ELFOSABI_WASMTIME, |
| 157 | abi_version: 0, |
| 158 | e_flags, |
| 159 | } if e_flags & obj::EF_WASMTIME_MODULE != 0 => Some(Precompiled::Module), |
| 160 | FileFlags::Elf { |
| 161 | os_abi: obj::ELFOSABI_WASMTIME, |
| 162 | abi_version: 0, |
| 163 | e_flags, |
| 164 | } if e_flags & obj::EF_WASMTIME_COMPONENT != 0 => Some(Precompiled::Component), |
| 165 | _ => None, |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | pub fn detect_precompiled_bytes(bytes: &[u8]) -> Option<Precompiled> { |
| 170 | detect_precompiled(ElfFile64::parse(bytes).ok()?) |
no test coverage detected