hrydgard/ppsspp — pull request #7055 by unknownbrackets (2014-11-06 07:03:55+00:00)
Title: Correct unload of imported vars

This is @level99procrastinator's patch, but slightly adjusted to make the original logic clearer.

The problem is that `exportAddress` should be subtracted from the sum of the lo and hi relocations when unexporting. On export, `exportAddress` was added, and our goal is to get the original lo and hi values back.

Adding the lo offset early was just making it confusing, although I wrote the original code (oops.)

https://github.com/hrydgard/ppsspp/issues/5192#issuecomment-61855156

Sounds like this fixes #5192. It may fix other module based games with problems too. Thanks go to @level99procrastinator for the catch.

-[Unknown]