Closed Gh0stBlade closed 3 years ago
To be clear, did this previously work (i.e. before #205), or are you not sure if this ever worked? These allocated regions are new, it's possible they have interacted with importobj incorrectly from the start.
In this example, how big is the object? How much data is inserted? You can log this by checking .notice toHex(org(), 16)
before and after the .importobj ...
.
-[Unknown]
Ok so upon further investigation, I have managed to solve this issue. The solution simply stores the value of org() in a label and sets the .org back to that old value after .org is changed in one of my includes. This is what appeared to be causing glitches within armips latest version (i changed org to patch a function but didn't restore it whilst it was inside .autoregion). It seems that the older versions of armips prior to #205 did not require this type of solution but i'll stick with it anyway.
I suppose we could issue a warning if you try to change org inside an autoregion... restoring it ought to be fine, but leaving it changed ought to have broken things before too.
-[Unknown]
.org BASE_ADDRESS+0x1AE180 .region 0x2DC6C0, 0x0 .asciiz "START_TRAE_PATCH" .endregion
.autoregion .importobj "FRMain\Psp\FRMainPSP.o" .endautoregion
This piece effectively is supposed to define a region between 0x1AE180 and 0x1AE180 + 0x2DC6C0 which it seems to do correctly. However, the ".autoregion" seems to write past the end of the region!