An object file is a file that contains machine code or bytecode, as well as other data and metadata, generated by a compiler or assembler from source code during the compilation or assembly process. The machine code that is generated is known as object code.

The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the same machine code can be packaged in different object file formats. An object file may also work like a shared library.

The metadata that object files may include can be used for linking or debugging; it includes information to resolve symbolic cross-references between different modules, relocation information, stack unwinding information, comments, program symbols, and debugging or profiling information. Other metadata may include the date and time of compilation, the compiler name and version, and other identifying information.

The term "object program" dates from at least the 1950s:

Further reading

  • Code: [https://archive.today/20200114225034/https://linker.iecc.com/code.html][ftp://ftp.iecc.com/pub/linker/] Errata: [https://linker.iecc.com/]
  • (NB. Description of the Microsoft REL file format for relocatable objects, also used by Digital Research.)
  • [https://www.seasip.info/Cpm/amsfid.html#PRL%20file%20format]
  • (16 pages)
  • (1+23 pages)
  • (1 page) (NB. Describes the history and relationship of IEEE 695 with CUFOM and MUFOM.)
  • (NB. Supersedes IEEE 695-1985 (1985-09-09)).