Commit 2b3088a857 for qemu.org

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

    linux-user/riscv: copy the executable's e_flags into core dumps

    Since commit 8c94db0ae97c ("binfmt_elf: preserve original ELF e_flags
    for core dumps"), Linux writes the main executable's e_flags into RISC-V
    core files, so debuggers can see the float ABI and RVC. QEMU wrote 0.

    Signed-off-by: Matt Turner <mattst88@gmail.com>
    Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/linux-user/riscv/target_elf.h b/linux-user/riscv/target_elf.h
index 185b81a2db..e99a9d92ca 100644
--- a/linux-user/riscv/target_elf.h
+++ b/linux-user/riscv/target_elf.h
@@ -21,6 +21,9 @@
 #define HAVE_ELF_HWCAP          1
 #define HAVE_ELF_CORE_DUMP      1

+/* See linux kernel: ARCH_HAS_ELF_CORE_EFLAGS.  */
+#define elf_core_eflags(info)   ((info)->elf_flags)
+
 /* Mirrors struct user_regs_struct: pc followed by x1 (ra) .. x31 (t6). */
 typedef struct target_elf_gregset_t {
     abi_ulong pc;