diff --git a/linux-user/alpha/elfload.c b/linux-user/alpha/elfload.c index 1969f620a5..7be9e466b6 100644 --- a/linux-user/alpha/elfload.c +++ b/linux-user/alpha/elfload.c @@ -6,6 +6,17 @@ #include "target_elf.h" +abi_ulong get_elf_hwcap(CPUState *cs) +{ + /* + * The Linux kernel computes ELF_HWCAP as ~amask(-1), which clears a bit + * for each supported ISA extension. env->amask stores exactly those bits + * set for the extensions supported by the emulated CPU model, matching + * the kernel's convention: bit set in AT_HWCAP ↔ extension present. + */ + return cpu_env(cs)->amask; +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPUAlphaState *env) { int i; diff --git a/linux-user/alpha/target_elf.h b/linux-user/alpha/target_elf.h index 4987ae3944..dd90c6f783 100644 --- a/linux-user/alpha/target_elf.h +++ b/linux-user/alpha/target_elf.h @@ -12,6 +12,7 @@ #define ELF_MACHINE EM_ALPHA #define HAVE_ELF_CORE_DUMP 1 +#define HAVE_ELF_HWCAP 1 /* * Matches the kernel's elf_gregset_t (ELF_NGREG = 33):