3.2   Terminology

Although the following terms are in common usage, we review the distinctions among them:

object file
The unrelocated output of a compiler or assembler (conventionally produced with a compiler's -c option, and named with a .o suffix).

object module
The contents of an object file.

object module format (OMF)
The convention in which the data in an object module is organized. Several different OMF standards exist, such as a.out, COFF, and ELF. On the whole, OMFs are independent from the underlying architecture. However, the relocation information contained in object modules is architecture dependent.

relocatable file
An object file for which text and data sections are in a transitory form, where some addresses are not yet known. These sections must be modified (relocated or linked) when they are loaded in order to be executable. In a cross-development environment, information not known about an object module at compilation time includes the program execution address (also called the entry point) and the addresses of externally defined symbols (such as library routines). By default, the loader assumes that some module addresses are unknown and that relocation is required.

executable file
A file that is fully linked and ready to run at a specified address. For such files, no relocation stage is required. The loader is able to load files that do not require a relocation stage, but it must be told that the file type is fully linked.

object module header
The portion of an object module that holds various information, such as the type of object module (often called the magic number) and the sizes of the different sections.

raw data
The main part of an object module, corresponding to the program code and data. The loader can handle four kinds of sections:

  • Text sections hold the program code.
  • Data sections hold the initialized program variables.
  • Bss sections hold the uninitialized program variables.
  • Literal sections hold the program constants and strings.
Depending on the OMF, an object module may contain several sections of each type. (This is true of both COFF and ELF.) It is also possible that the text and data sections may be the only two sections in the module. (The a.out format follows this model; however, a.out sections are typically referred to as segments.)

symbol entries
Information about every symbol defined (local symbols) or referred to (external symbols) in the object module. The term symbol refers to every variable, routine, or constant that is accessible from other parts of the program (public).

relocation entries
Information required to adapt the program to its execution environment. The relocation entries point to each place where a relocation is required, and indicate the type of operation required to perform it.

string table
A table containing all symbol strings. For a.out and ELF it holds all strings; for COFF it holds only strings larger than a certain size.