summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2024-03-23 14:53:19 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-03-23 13:20:51 +0100
commitd8400c4394197317b722d6fa6aab47b1776f5176 (patch)
tree3896e5f5a171a34a080e114541725e50bfb9782e
parent1adea9ccce9e07037506d069a73f048b50c40561 (diff)
exec: Add support for AArch64 executables
This maps to EM_AARCH64. Just like the x86_64 branch, we only compile this code if CPU_TYPE_ARM64 is defined in Mach headers, to avoid raising Mach version requirement on other architectures; and we explicitly enable the branch when building for AArch64 itself, to get a build error if CPU_TYPE_ARM64 is somehow not defined. Message-ID: <20240323115322.69075-7-bugaevc@gmail.com>
-rw-r--r--exec/hostarch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/exec/hostarch.c b/exec/hostarch.c
index ed50e0a8..81bbeb63 100644
--- a/exec/hostarch.c
+++ b/exec/hostarch.c
@@ -90,6 +90,11 @@ elf_machine_matches_host (ElfW(Half) e_machine)
case CPU_TYPE_HPPA:
CACHE (e_machine == EM_PARISC);
+#if defined (CPU_TYPE_ARM64) || defined(__aarch64__)
+ case CPU_TYPE_ARM64:
+ CACHE (e_machine == EM_AARCH64);
+#endif
+
default:
return EGRATUITOUS; /* XXX */
}