2006/10/17/23.37 – The Yasm Modular Assembler Project

2006/10/17/23.37

RDOFF2 support

I took a break from multi-section binary to work on and complete RDOFF2. It landed in [1650] (with some build updates in later commits). It was really pretty painless, and took me about a day and a half to complete. Of course the object format is pretty simple, but it definitely helped to have an excellent RDOFF2 dump utility to confirm I was generating the right things in the right places.

Unfortunately I would say the format is a bit TOO simple: the fact that relocs come before the sections creates unneeded pain; it would have been far easier to deal with if, like every other format, the relocs come *after* the section data. Right now we end up generating the section data into memory (ugh) in order to generate the relocations, then just dump the memory contents out to the file. It works, but it's not pretty.

NASM's support for more than just the default RDOFF2 sections seems to be a bit lackluster; I've made sure it works in yasm even though it appears to not work in NASM. I'm also more efficient about not generating unneeded size-0 sections. Hopefully that doesn't break any RDOFF2 loader assumptions.

With how easy RDOFF2 ended up being, I may work on OMF (aka OBJ) before multi-section binary. Multi-section binary is kind of a pain because just like the original binary format, I have to do all the work myself and not just leave half of it up to the linker :).