Re: [hatari-devel] Relocation warning + program failing when run from GEMDOS HD

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 28.9.2022 20.42, Thomas Huth wrote:
Am Wed, 28 Sep 2022 11:16:23 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
Just waiting long time before starting the program is not enough, it
actually needs to crash first.

WTF???

Well, the program has a corrupt relocation table, so if TOS is not checking
for the length of the relocation table and just looks for the terminating
NUL byte, the behavior of course depends on the contents of the memory that
were there right after the non-terminated table, so depending on whether
there was a NUL byte immediately following or not, the program might have
worked or the relocation process might have corrupted random other
locations of memory.

This was with GEMDOS HD, i.e. where your gemdos.c code was doing the relocation...



Anyway, the program is just corrupt. There is not much we could do from the
emulator side execpt to mention it as bad in the compatibility.html doc and
recommend a TOS version that might work by chance.

Looking at GEMDOS HD relocation code, while it checks validity of relocation table index offset, it does not check whether the actual relocation offset is valid.

Shouldn't that be always within nTextLen + nDataLen?

Or are there some clever programs that use relocation table to initialize their BSS, or even write stuff at start of memory due to TOS some code relocation offset wraparound?


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/