
I just want to remark that anyone contemplating hacking on object files should steer well clear of BFD which is the most inconsistently implemented, poorly (though abundantly) documented obstacle to quality programming it has ever been my misfortune to use. Particularily galling is the fact that BFD provides little indication (in documentation, compile-time errors, etc.) that certain functionality is completely unimplemented on a particular platform.
In contrast, libelf is widely available (multiple implementations exist), well documented, a joy to use and covers everything (well, everything that GHC runs on) but Windows.
Thanks, I didn't know about libelf. That might be a good replacement for our custom linker (at least on ELF platforms) at some point. Cheers, Simon