File format
Many object file formats consist of a set of tables, such as the relocation table, which are either stored on fixed positions in the file, like theDGROUP
* FIXUPP - (9Ch/9Dh) ''Fixup'' or relocation records
* LEDATA - (A0h/A1h) Contains text of a code or data section
* COMDEF - (B0h) Uninitialized common data
* COMDAT - (C2h/C3h) Initialized common data
* MODEND - (8Ah/8Bh) Indicates end of module
There is no header containing file offsets, such as a pointer to a symbol table, in the file; a linker must completely parse the object file to extract all the information.
In the OMF format the data of one section is not necessarily stored as contiguous bytes in the file, instead it ''can'' be represented by multiple records. The file format specification (version 1.1) says that this ''must'' be done for sections larger than 1 KiB. Records containing relocation information (fixups) must be stored immediately following the data records of the section they apply to, so the section data and the relocation information is "mixed" in the file.
The file format provides special records (LIDATA) that allow compression of repeating data sequences in an object file. It also provides the possibility to store the symbol name of the entry point of the later executable file in one object file.
The file format can also be used as library file format.
Use
The file format is the most important object file format under DOS, 16-bit Windows, and 16-bit and 32-bit OS/2. Few toolchains use the 32-bit version of the OMF format. For example, the Watcom C toolchain allows generating code for targets that use 32-bit segmented memory layouts; Iron Spring PL/I can generate code for OS/2 32-bit flat memory layouts. The Embarcadero Delphi compiler used this format when generatingobj
files for C++. It was the only format of object files that could be linked to a program or unit written in Object Pascal prior to version XE2 of Delphi, which introduced support of COFF format, along with 64-bit Windows target.
See also
* Common Object File Format (COFF) * Executable and Linkable Format (ELF) *References
Further reading
* Code