Introduction
OMF, the Object Module Format, is the object file format Intel defined for the 8086 (the TIS text refers to “the original Intel 8086 specification”). It was the main object format on DOS, 16-bit Windows and OS/2, and Microsoft and IBM each extended it. A linker such as Microsoft LINK joined OMF files into an MZ or NE program. Intel’s 80386 form dates from 1985; few toolchains use the 32-bit form, but Watcom C can generate code for 32-bit segmented targets, and Phar Lap’s Easy OMF is a 32-bit variant (see Extensions outside the TIS specification). Sources: Wikipedia’s “Object Module Format (Intel)” for the history and the list of tools; the TIS text for the 8086 origin.
Libraries of OMF object files also use the .lib extension, in a format
of their own: an OMF library. Modern Windows compilers write
COFF object files instead. See
all the .OBJ variations.
Structure
An OMF file is a sequence of records. Each starts with a one-byte record type and a 16-bit little-endian length, which counts the rest of the record including a final checksum byte (the whole record is 3 bytes plus that length). The checksum is the negative sum modulo 256 of all the other bytes, so the sum of every byte in the record, checksum included, is zero in its low byte. Some compilers write 0 instead of computing it, so a reader should accept either. Unless a record type says otherwise, a whole record is at most 1024 bytes. Words and double words are little-endian.
Many record types come in pairs: the even number has 16-bit numeric fields (sizes, offsets, displacements) and the odd number has 32-bit ones. This chooses only the field width; it does not decide whether a segment is Use16 or Use32, which the SEGDEF attribute byte sets, so 16-bit records can describe a 32-bit segment and the reverse. Source: TIS Portable Formats Specification 1.10, “The Object Record Format”.
A module begins with a THEADR record (0x80) or an LHEADR record
(0x82), which hold its name, usually
the source file name, and ends with a MODEND record (0x8A or
0x8B). The TIS text says the first record must be THEADR or LHEADR and
the last MODEND. Records that refer to others must come after them (an LNAMES record
before any SEGDEF or GRPDEF that refers to it). The recommended order puts the symbol
and definition records first, then the optional link pass separator (a COMENT of class
0xA2, after which many linkers stop their first pass), then LEDATA,
LIDATA, FIXUPP, BAKPAT, INCDEF and LINNUM records, then MODEND; the order is
recommended, not mandatory. Between them, LNAMES
(0x96) lists names, SEGDEF and
GRPDEF (0x98 and 0x9A) define segments and groups,
EXTDEF and PUBDEF (0x8C and
0x90) list the symbols the module needs and provides,
LEDATA and LIDATA (0xA0 and
0xA2) carry the code and data, and
FIXUPP (0x9C) records say
which addresses the linker must fill in.
COMENT records (0x88) carry
compiler notes and extensions, and LINNUM and
LINSYM carry line numbers.
+0record type, such as0x80THEADR1 byte+1record length, counting the contents and the checksum2 bytes+3contents, laid out by record typelength − 1 bytes…checksum1 byte
Extensions outside the TIS specification
The TIS text describes the Microsoft and IBM dialect. It says the original Intel 8086
specification differed in places (extra SEGDEF alignment values, a Common combination
value of 1 instead of 6, extra GRPDEF component types 0xFE,
0xFD, 0xFB and 0xFA, none supported by
Microsoft LINK or IBM LINK386); those conflicts are on the
segments page. What follows is what public sources show for the
other dialects. Each item names its source; anything not read is listed under
Known, not yet covered on the overview.
| Extension | What the source says | Source |
|---|---|---|
| Intel 8086 records | Record numbers 0x6E RHEADR, 0x70 REGINT, 0x72 REDATA, 0x74 RIDATA, 0x76 OVLDEF, 0x78 ENDREC, 0x7A/0x7B BLKDEF (16-/32-bit), 0x7C/0x7D BLKEND, 0x7E DEBSYM, 0x84 PEDATA, 0x86 PIDATA, 0x8E TYPDEF, 0x92 LOCSYM, and library records 0xA4 LIBHED, 0xA6 LIBNAM, 0xA8 LIBLOC, 0xAA LIBDIC. Their field layouts are not given here: Intel’s manual (121748-001) could not be fetched (bitsavers answered 403, which was not worked around; an archive.org copy timed out). | Open Watcom pcobj.h (names and numbers only) |
| Microsoft | COMENT class 0xA0 subtypes 1 to 6 (IMPDEF, EXPDEF, INCDEF, protected-memory library, LNKDIR, big-endian), documented on the COMENT page. The TIS text calls COMDEF, LEXTDEF, LPUBDEF and LCOMDEF extensions to the original 8086 record set, and says two of them were added for Microsoft C 5.0 and one for Microsoft C 7.0; pcobj.h notes BAKPAT and NBKPAT as Quick C backpatch records. | TIS 1.10; pcobj.h |
Borland dependency file, class 0xE9 | Shows the include files used to build the object. After the class byte: a 16-bit DOS time, a 16-bit DOS date, a one-byte name length and the file name (pcobj.h’s omf_coment_dep; NASM’s omfdump.c decodes the same four fields as a DOS date and time followed by the name). The TIS text lists the class as “(Borland)”. | TIS 1.10; pcobj.h; NASM omfdump.c |
| Borland debug classes | VirtualBox’s omf.h names class 0xE3 as Borland type information, 0xE6 as Borland symbol information and 0xE8 as a Borland source file name that applies to the LINNUM records after it (it also lists 0x88 as a dependency-file class, which differs from the 0xE9 the other sources use). The contents of the type and symbol classes are not described by any source read. | VirtualBox omf.h |
| Other vendor classes | NASM’s dumper names 0xDA Comment, 0xDB Compiler, 0xDC Date, 0xDD Timestamp and 0xDF User; the TIS text covers DB to DF as pragma comments. 0xFF is the Microsoft QuickC command line in the TIS text. | TIS 1.10; NASM omfdump.c |
| Open Watcom | COMENT class 0x9B processor and model information (four bytes: processor, memory model, an unknown byte, emulation); class 0xFD, a disassembler directive ('S' and 's' scan tables: a segment index, then start and end+1 offsets, words in ordinary objects and double words in Easy OMF and Microsoft 386; segment index 0 is followed by an LNAMES index naming a COMDAT); class 0xFE, a linker directive whose first byte is a letter: D debug version and source language, L default library, O optimise far calls for this segment, U far-call optimisation unsafe for a fixup, V virtual-function table lazy extdef, P the same for pure functions, R virtual-function reference, 7 amount to pack far data, F debug addresses are flat, T file time stamp of an object in a library. The data after each letter is not described by any source read. | pcobj.h (the comments of the enumerations) |
| Phar Lap Easy OMF-386 | COMENT class 0xAA carries the signature 80386. FIXUPP Location 5 is a 32-bit offset and Location 6 a 48-bit pointer (conflicting with the IBM and Microsoft values 9 and 11); the repeat count of LIDATA is 16 bits even in 32-bit records. The SEGDEF attribute byte differs: bit 2 is Use32 and bits 1 to 0 are the protection (0 read-only, 1 execute-only, 2 execute/read, 3 read/write). A Symantec-derived compiler source defines the Easy OMF 32-bit offset fixup as 0x1400 against Microsoft’s 0x2400 (an encoding of the fixup word as a compiler writes it, not a file value). The Easy OMF-386 document itself was not found. | TIS 1.10; pcobj.h (EASY_*); Digital Mars/Symantec cgobj.c as seen in a web search result, not read in full |
| IBM | The IBM LINK386 behaviour differs from Microsoft’s in the places the TIS text marks (4096-byte page alignment, ignored LIBMOD, NOPAD and LZEXT comments, 32-bit offset Location 9). IBM’s own OMF and LX document (revision 8, June 1994) was downloaded for this check but is not yet read through. | TIS 1.10 |
Not described
The gaps are those on the object file overview. For OMF, the pages
were checked against the TIS Portable Formats Specification 1.10 on 2026-11-19 (this overview page too, line by line) and against Open Watcom’s pcobj.h, and the layouts on 423 real files.
Outside that document: the field layouts of Intel’s old 8086 records (the Intel manual could not be fetched), the contents of Borland’s type and symbol classes, the data of Open Watcom’s 0xFE letters, the Easy OMF-386 document and the IBM OMF and LX document are Known and not yet covered; vendor COMENT
classes beyond those listed above are not decoded.
Also used for
- Wavefront OBJ – A plain text mesh of vertices, normals and faces, read by almost every 3D program.
Variants
- OMF object file – Intel’s object format for 16-bit DOS and Windows compilers, in typed records
- COFF object file – compiled code from Windows compilers, waiting for the linker
- COFF object file (bigobj) – the extended form of COFF, for objects with very many sections
- Anonymous object header – the wrapper Microsoft’s compiler writes for link-time code generation
Links
Software
- Open Watcom – compiler suite that writes OMF, with
wlinkandwdisto link and disassemble it (Windows, Linux, DOS, OS/2) - NASM – assembler that writes OMF with
-f obj(Windows, macOS, Linux) - objconv – converts OMF to and from COFF, ELF and Mach-O (Windows, macOS, Linux)
- IDA Pro – commercial disassembler and decompiler (Windows, macOS, Linux)
Reference
- Object Module Format (Intel) – Wikipedia’s overview, with links to the Tool Interface Standards specification