mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
LibELF: Add EM_AARCH64 as expected architecture for ELF validation
This commit is contained in:
parent
163e3ac90b
commit
daf7f43135
|
@ -59,12 +59,12 @@ bool validate_elf_header(ElfW(Ehdr) const& elf_header, size_t file_size, bool ve
|
|||
return false;
|
||||
}
|
||||
|
||||
auto expected_machine = EM_X86_64;
|
||||
auto expected_machine_name = "x86-64";
|
||||
auto expected_machines = Array { EM_X86_64, EM_AARCH64 };
|
||||
auto expected_machine_names = Array { "x86-64"sv, "aarch64"sv };
|
||||
|
||||
if (expected_machine != elf_header.e_machine) {
|
||||
if (!expected_machines.span().contains_slow(elf_header.e_machine)) {
|
||||
if (verbose)
|
||||
dbgln("File has unknown machine ({}), expected {} ({})!", elf_header.e_machine, expected_machine_name, expected_machine);
|
||||
dbgln("File has unknown machine ({}), expected {} ({})!", elf_header.e_machine, expected_machine_names.span(), expected_machines.span());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue