On 5/21/26 20:43, Matt Turner wrote:
Define HAVE_ELF_CORE_DUMP and target_elf_gregset_t in target_elf.h,
mirroring struct user_regs_struct: pc followed by x1 (ra) through
x31 (t6).  Implement elf_core_copy_regs() in elfload.c to populate
the gregset from CPURISCVState.

Without this, bprm->core_dump is NULL for RISC-V targets.  When a
guest signal goes unhandled, dump_core_and_abort() skips the core
write and falls through to die_with_signal(), which re-raises the
signal to the host.  The host kernel then writes an x86-64 core file
for the qemu-riscv64 process instead of a RISC-V guest core.
---
  linux-user/riscv/elfload.c    | 9 +++++++++
  linux-user/riscv/target_elf.h | 7 +++++++
  2 files changed, 16 insertions(+)


I added the missing
Signed-off-by: Matt Turner <[email protected]>

and added the patch to linux-user-next git tree.

Thanks!
Helge

Reply via email to