The gpsp was my first emulator port with dynamic recompilation. The problem in memory mapping and dynarec is that local data in Symbian OS is too far away from the user area, where we the new memory chunk for the dynamic area was created. My first solution was the memory trampoline pattern.
However I got an optimal solution from Olli Hinkka. The solution is called dynamic text segment relocation routine. Basically the relocator is relocating the process into the user memory are in Symbian. With this approach no memory trampoline is required, since the static side is close enough to the dynamic side.
How to use it:
You’ll need Olli Hinkka’s relocator code. You can find it at least from gpsp github. relocutils.h relocator.cpp and relocator_glue.S
First you’ll have to relocate your process on the user area in the Symbian. The user local data area is between 0×004-0×38000000, see the Symbian OS memory map. I’m using 0×10000000 in this example.