Relocatable Object Module Format
Encyclopedia
The Relocatable Object Module Format is an object file
Object file
An object file is a file containing relocatable format machine code that is usually not directly executable. Object files are produced by an assembler, compiler, or other language translator, and used as input to the linker....

 format
File format
A file format is a particular way that information is encoded for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa. There are different kinds of formats for...

 used primarily for software intended to run on Intel 80x86 microprocessor
Microprocessor
A microprocessor incorporates the functions of a computer's central processing unit on a single integrated circuit, or at most a few integrated circuits. It is a multipurpose, programmable device that accepts digital data as input, processes it according to instructions stored in its memory, and...

s. It was originally developed by Intel under the name Object Module Format, and is perhaps best known to DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 users as a .OBJ file. It has since been standardised by the Tool Interface Standards Committee.

File format

The file format differs very much from other object file formats.

Most other object file formats (like COFF
COFF
The Common Object File Format is a specification of a format for executable, object code, and shared library computer files used on Unix systems...

 which is used on modern Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 variants) use a file header and different tables (such as the relocation table). These tables are either stored on fixed positions in the file (like in the a.out format) or pointers to the tables are used (like in the ELF
Executable and Linkable Format
In computing, the Executable and Linkable Format is a common standard file format for executables, object code, shared libraries, and core dumps. First published in the System V Application Binary Interface specification, and later in the Tool Interface Standard, it was quickly accepted among...

 format). The data of the "sections" (e.g., code, data area, ...) are stored as contiguous area of bytes within such files.

The Relocatable Object Module Format (OMF) however consists of so-called records that have the following format:
  • 1 byte record type (e.g. relocation information)
  • 2 bytes data length (N+1)
  • N bytes data (depending on the record type)
  • 1 byte checksum or 0

There are no file offsets (like a pointer to a symbol table) in the file. Therefore a linker must parse all entries (records) of the object file to get information about it.

Unlike other object file formats in the OMF format data of one section (e.g., code) is not represented as contiguous bytes in the file. Instead the data of one section (e.g., the code section) can be represented by multiple records. The file format specification (version 1.1) says that this must be done for sections larger than 1KiB. Records with relocation information (fixups) must be stored between the data records of a section so the section data and the relocation information is "mixed" in the file.

The file format provides special records that allows 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
Static library
In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable...

 file format.

Use

The file format was the most important object file format under DOS, 16-bit Windows and OS/2.

The format also supports 32-bit code; however only few tool chains use the 32-bit version of the OMF format. The Watcom C
Watcom C compiler
The Watcom C/C++ compiler is a compiler for the computer programming languages C and C++ that produces executable programs for several platforms and operating systems. The code it produces for MS-DOS executes very fast. It was one of the first compilers to support the Intel 80386 "protected mode"...

 tool chain is one of the rare examples. This tool chain allows generating code for targets that use 32-bit segmented memory layouts. Because most other object file formats do not support segmentation Watcom C uses the OMF file format.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK