<!-- 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
| 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 |
no test coverage detected