Object File - Object File Formats

Object File Formats

An object file format is a computer file format used for the storage of object code and related data.

There are many different object file formats; originally each type of computer had its own unique format, but with the advent of Unix and other portable operating systems, some formats, such as COFF and ELF have been defined and used on different kinds of systems. It is possible for the same file format to be used both as linker input and output, and thus as the library and executable file format.

The design and/or choice of an object file format is a key part of overall system design. It affects the performance of the linker and thus programmer turnaround while developing. If the format is used for executables, the design also affects the time programs take to begin running, and thus the responsiveness for users. Most object file formats are structured as blocks of data, each block containing a certain type of data (see Memory segmentation). These blocks can be paged in as needed by the virtual memory system, needing no further processing to be ready to use.

Debugging information may either be an integral part of the object file format, as in COFF, or a semi-independent format which may be used with several object formats, such as stabs or DWARF.

The GNU Project's Binary File Descriptor library (BFD library) provides a common API for the manipulation of object files in a variety of formats.

Types of data supported by typical object file formats:

  • Header (descriptive and control information)
  • Text segment (executable code)
  • Data segment (static data)
  • BSS segment (uninitialized data)
  • External definitions and references for linking
  • Relocation information
  • Dynamic linking information
  • Debugging information

Read more about this topic:  Object File

Famous quotes containing the words object and/or file:

    I often used to think myself in the case of the fox-hunter, who, when he had toiled and sweated all day in the chase as if some unheard-of blessing was to crown his success, finds at last all he has got by his labor is a stinking nauseous animal. But my condition was yet worse than his; for he leaves the loathsome wretch to be torn by his hounds, whilst I was obliged to fondle mine, and meanly pretend him to be the object of my love.
    Sarah Fielding (1710–1768)

    I have been a soreheaded occupant of a file drawer labeled “Science Fiction” ... and I would like out, particularly since so many serious critics regularly mistake the drawer for a urinal.
    Kurt Vonnegut, Jr. (b. 1922)