Open zlago opened 1 year ago
I'd say that a better fix would be to randomize all ROM padding in scramble mode, and to possibly shift sections by a few bytes when there's free space to do so. However, shifting sections would probably require rerunning the linker...
That’s the issue I see with this. No matter how it’s implemented, the misalignment would cause fragmentation, which might cause a scrambled build to fail when a normal one wouldn’t.
The way I see it, allocating sections primarily towards the end of ROMX would help catch OOB accesses there, as then those accesses would tend to fall in VRAM (then it's a die roll as to whether a VRAM access exception is triggered, but better than nothing) or SRAM (which is most often locked).
Additionally, I see no harm in doing thins by default outside of -x
mode. (Sure, that would change section order, but this should not be as breaking a change since #136's resolution.)
Putting the sections at the end is a really good idea, I didn't consider that.
i didnt intend on solving both problems.. i only really thought of it as "should be a cheap way to put a section at somewhere other than the start"
while the scramble flag does serve its purpose of showing when you forget to bankswitch, it introduces two new issues:
$4000
possible solutions for each issue:
$4000
(the former is probably better)the second one probably isnt as much of an issue as the first, as its me not testing the non-scrambled build..