mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
LibELF: Add EM_AARCH64 as expected architecture for ELF validation
This commit is contained in:
parent
163e3ac90b
commit
daf7f43135
Notes:
sideshowbarker
2024-07-17 00:41:25 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/daf7f43135 Pull-request: https://github.com/SerenityOS/serenity/pull/17249 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/nico ✅ Reviewed-by: https://github.com/supercomputer7
@ -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 New Issue
Block a user