MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / load_elf_file

Function load_elf_file

kernel/tests/src/ext_t/behavior.cpp:270–285  ·  view source on GitHub ↗

<!-- description --> @brief Loads the initial state of an ELF file. <!-- inputs/outputs --> @param mut_file the ELF file to load @param phdr_table the program header table to use

Source from the content-addressed store, hash-verified

268 /// @param phdr_table the program header table to use
269 ///
270 constexpr void
271 load_elf_file(loader::ext_elf_file_t &mut_file, phdr_table_t const &phdr_table) noexcept
272 {
273 mut_file.e_type = bfelf::ET_EXEC.get();
274 *mut_file.e_ident.at_if(bfelf::EI_MAG0) = bfelf::ELFMAG0.get();
275 *mut_file.e_ident.at_if(bfelf::EI_MAG1) = bfelf::ELFMAG1.get();
276 *mut_file.e_ident.at_if(bfelf::EI_MAG2) = bfelf::ELFMAG2.get();
277 *mut_file.e_ident.at_if(bfelf::EI_MAG3) = bfelf::ELFMAG3.get();
278 *mut_file.e_ident.at_if(bfelf::EI_CLASS) = bfelf::ELFCLASS64.get();
279 *mut_file.e_ident.at_if(bfelf::EI_OSABI) = bfelf::ELFOSABI_SYSV.get();
280
281 mut_file.e_phdr = phdr_table.data();
282 mut_file.e_phnum = bsl::to_u16(phdr_table.size()).get();
283
284 mut_file.e_entry = HYPERVISOR_PAGE_SIZE.get();
285 }
286
287 /// <!-- description -->
288 /// @brief Used to execute the actual checks. We put the checks in this

Callers 1

behavior.cppFile · 0.85

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected