On Thu, 5 Nov 2026 03:34:15 GMT, Fei Yang <[email protected]> wrote: >> Kevin Walls has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update. Includes reverting removal of DebuggingContext and error handling >> in HotSpotVirtualMachineCoreDump.java > > src/jdk.attach/linux/native/revivalhelper/elffile.cpp line 59: > >> 57: #else >> 58: case R_X86_64_RELATIVE: >> 59: #endif > > @kevinjwalls : Hi, do you mind adding the following small addon change to > support core revival on riscv64? The new test > `test/hotspot/jtreg/serviceability/revival/JCmdRevival.java` fails on this > platform without this addon change and passes otherwise. > > > diff --git a/src/jdk.attach/linux/native/revivalhelper/elffile.cpp > b/src/jdk.attach/linux/native/revivalhelper/elffile.cpp > index 8e73e0f78e4..40211c3cb26 100644 > --- a/src/jdk.attach/linux/native/revivalhelper/elffile.cpp > +++ b/src/jdk.attach/linux/native/revivalhelper/elffile.cpp > @@ -54,6 +54,8 @@ bool should_relocate_addend(Elf64_Rela* rela) { > switch (ELF64_R_TYPE(rela->r_info)) { > #if defined(__aarch64__) > case R_AARCH64_RELATIVE: > +#elif defined(__riscv) && __riscv_xlen == 64 > + case R_RISCV_RELATIVE: > #else > case R_X86_64_RELATIVE: > #endif > @@ -114,6 +116,11 @@ bool ELFFile::verify() { > warn("%s: not an AARCH64 ELF file.", filename); > return false; > } > +#elif defined(__riscv) && __riscv_xlen == 64 > + if (hdr->e_machine != EM_RISCV) { > + warn("%s: not a RISCV64 ELF file.", filename); > + return false; > + } > #else > if (hdr->e_machine != EM_X86_64) { > warn("%s: not an X86_64 ELF file.", filename);
That's great. I don't build/test riscv, but if this works for you on riscv then it's good to have it, thanks! No impact on the builld and test here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31011#discussion_r4479247891
