All definitions of ELF_HWCAP2 are now identical. Provide a not-reached stub as a fallback definition of get_elf_hwcap2.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org> --- linux-user/elfload.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 88d439f348..7a41917b49 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -448,8 +448,6 @@ static bool init_guest_commpage(void) return true; } -#define ELF_HWCAP2 get_elf_hwcap2(thread_cpu) - #define ELF_PLATFORM get_elf_platform() static const char *get_elf_platform(void) @@ -537,8 +535,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 -#define ELF_HWCAP2 get_elf_hwcap2(thread_cpu) - #if TARGET_BIG_ENDIAN # define VDSO_HEADER "vdso-be.c.inc" #else @@ -593,8 +589,6 @@ static inline void init_thread(struct target_pt_regs *regs, #define ELF_ARCH EM_PPC -#define ELF_HWCAP2 get_elf_hwcap2(thread_cpu) - /* * The requirements here are: * - keep the final alignment of sp (sp & 0xf) @@ -1279,6 +1273,10 @@ static inline void init_thread(struct target_pt_regs *regs, #ifndef HAVE_ELF_HWCAP abi_ulong get_elf_hwcap(CPUState *cs) { return 0; } #endif +#ifndef HAVE_ELF_HWCAP2 +abi_ulong get_elf_hwcap2(CPUState *cs) { g_assert_not_reached(); } +#define HAVE_ELF_HWCAP2 0 +#endif #include "elf.h" @@ -1801,9 +1799,9 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, #ifdef DLINFO_ARCH_ITEMS size += DLINFO_ARCH_ITEMS * 2; #endif -#ifdef ELF_HWCAP2 - size += 2; -#endif + if (HAVE_ELF_HWCAP2) { + size += 2; + } info->auxv_len = size * n; size += envc + argc + 2; @@ -1863,10 +1861,9 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, NEW_AUX_ENT(AT_SECURE, (abi_ulong) qemu_getauxval(AT_SECURE)); NEW_AUX_ENT(AT_EXECFN, info->file_string); -#ifdef ELF_HWCAP2 - NEW_AUX_ENT(AT_HWCAP2, (abi_ulong) ELF_HWCAP2); -#endif - + if (HAVE_ELF_HWCAP2) { + NEW_AUX_ENT(AT_HWCAP2, get_elf_hwcap(thread_cpu)); + } if (u_base_platform) { NEW_AUX_ENT(AT_BASE_PLATFORM, u_base_platform); } -- 2.43.0