https://bugs.winehq.org/show_bug.cgi?id=54432
--- Comment #4 from Eric Pouech eric.pouech@gmail.com --- thanks Axel for providing a minimal reproducer with the .exe in #3
------------------ with patch from #3 applied I get: [eric]$ ../../wine64/wine ./wine-54432.exe Hello Wine!
which is was is expected I think (looking at Java source code).
------------------ [eric]$ winedump -x ./wine-54432.exe
contains in the sections' list: ... .svm_hea VirtSize: 0x006eb000 VirtAddr: 0x0044a000 raw data offs: 0x00449000 raw data size: 0x006eb000 relocation offs: 0x00000000 relocations: 0x00000000 line # offs: 0 line #'s: 0 characteristics: 0x40000040 INITIALIZED_DATA MEM_READ ... which really looks like (from its name) like a dedicated section containing a heap copy.
Axel, can you try with patch in #2 applied if it works for more sophisticated use cases?
I'm still surprised of not getting errors in the first test above. There's no relocation info (from PE format) to the .svm_hea section. So either Native uses an ad hoc allocator, with serialization. But unserializing will likely change the address of allocated objects. So either there's also relocation information in the .svm_heap or there's an additional indirection in place.