From: Matt Turner <[email protected]>

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 <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
---
 linux-user/riscv/target_elf.h | 3 +++
 1 file changed, 3 insertions(+)

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;
-- 
2.54.0


Reply via email to