[PATCH] OMF support for BFD

Bernd Jendrissek bernd.jendrissek@gmail.com
Sun Sep 18 01:06:00 GMT 2011


It's about time I submitted this.  Somewhere in the world it must
still be Software Freedom Day.  Sorry about the code-dumpish nature, I
only recently put in the time to get this useful enough to be worth
contributing.  For the bored / sleepless, back story and sample output
at http://bpj-code.blogspot.com/2011/09/omf-support-for-binutils.html

bfd/ChangeLog (but I have a stream of a few dozen patch+ChangeLog
leading up to this bit by bit, if that is more useful? might help
bisections):

2011-09-18  Bernd Jendrissek  <bernd.jendrissek@gmail.com>

    * Makefile.am: Add files for OMF support.
    * Makefile.in: Regenerate.
    * bfd-in2.h (bfd_flavour): Add OMF flavour.
    * i386omf.c: New file.
    * strtab.c: New file.
    * strtab.h: New file.
    * targets.c: Add OMF target vector.

I'm not too happy about the name of strtab.[hc]; it started as a
growable array-of-strings, but by now it has mutated into polymorphism
- it's now a growable array-of-void*.  Any suggestions on what to do
about the misleading name?  Also, I'm unconvinced that the reloc names
I chose are particularly good ones.

I have aimed only to support objdump functionality; IMHO for this
anachronism of a file format that's where the bulk of the remaining
value for its support lies.  I might one day be tempted to teach ld to
link OMF files into an MZ EXE, but that day is not today.  And as for
gas, that looks like an awful lot of work just to do something that
NASM can already do.  That does leave the question about what to do
about test cases for the testsuite - it would be rather icky to have
binary object files in the repository!

Does anybody have access to MASM?  For that matter, Borland's Turbo
Assembler?  These would be probably the most common tools generating
OMF objects from assembly, two decades ago.  DJ has kindly send me a
few (simple) Turbo Assembler output files - I'm hoping someone can
send me something meatier.  There are probably some corner cases /
interpretation issues lurking in my port.  Any other tools' outputs
would be welcome too, of course - the more esoteric, the better!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-omf.diff
Type: text/x-patch
Size: 70460 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20110918/e09212a2/attachment.bin>


More information about the Binutils mailing list