Commit b508dd9c65 for qemu.org

commit b508dd9c659331dd306a2b03eea01c5dff29ea2c
Author: Matt Turner <mattst88@gmail.com>
Date:   Sat Sep 26 00:08:11 2026 -0400

    linux-user/mips64: set EF_MIPS_ABI2 in mipsn32 core dumps

    mipsn32 core files had e_flags 0, so gdb took them for o32, found no
    general-purpose registers and failed with an internal error in
    frame_unwind_find_by_frame.

    Linux sets e_flags to EF_MIPS_ABI2 for n32 cores (user_mipsn32_view in
    arch/mips/kernel/ptrace.c).

    Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h
index efb5d97563..fd9fb89269 100644
--- a/linux-user/mips64/target_elf.h
+++ b/linux-user/mips64/target_elf.h
@@ -16,6 +16,8 @@

 #ifdef TARGET_ABI_MIPSN32
 #define elf_check_abi(x)        ((x) & EF_MIPS_ABI2)
+/* See linux kernel: arch/mips/kernel/ptrace.c, user_mipsn32_view.  */
+#define elf_core_eflags(info)   EF_MIPS_ABI2
 #else
 #define elf_check_abi(x)        (!((x) & EF_MIPS_ABI2))
 #endif