Page 1 of 1

updates to rdoff2 object format...!?

Posted: Tue Mar 18, 2008 8:43 pm
by carbonBased
I've been happily using LCC to produce NASM output, which is then assembled into RDOFF2 objects for some time now.

I recently came into a very weird invalid opcode exception, however, while creating my keyboard driver.

After much investigation, I found it was actually the fault of NASM. It was actually incrementing a 0x8b opcode to 0x8c due to an overflow when patching up the address prior to the opcode.

So, long story short, I've upgraded to version 2.02 and noted that the resultant object has correct opcodes. However, when I attempt to actually load and link the object if fails right away. It seems that the RDOFF2 object format has changed just slightly from my previous tools (NASM 0.99.38 ) to the current ones (2.02).

Does anybody know/have any further documentation on this? I remember, a long time ago, reading about a possible change in the format, but can't seem to find details of that. The v1-v2 document which is included in the 2.02 distribution isn't any different then the one in the 0.99.38 distribution).

Any help would be greatly appreciated.

Thanks,
Jeff

Posted: Thu Mar 20, 2008 8:58 am
by carbonBased
FYI - the answer was obvious once I realized I had source code for rdfdump from 0.99.38 and 2.02. I diff'ed them and noticed that the import and far_import records now have an extra byte -- a flags byte.

I've added support for this into my RDOFF2 loader and things are now loading correctly.

Seems kinda freaky though that there's no way to tell the difference between an RDOFF2 object created from the former linker, and an RDOFF2 object created from a recent linker, given that the formats are actually different but share the same version.

--Jeff