Object Code Definition

Object code is the output of a compiler after it processes source code.

Source code is the version of a computer program as it is originally written (i.e., typed into a computer) by a human in a programming language. A compiler is a specialized program that converts source code into object code.

The object code is usually a machine code, also called a machine language, which can be understood directly by a specific type of CPU (central processing unit), such as x86 (i.e., Intel-compatible) or PowerPC. However, some compilers are designed to convert source code into an assembly language or some other another programming language. An assembly language is a human-readable notation for the machine language that a specific type of CPU uses.

A machine code file can be immediately executable (i.e., runnable as a program), or it might require linking with other object code files (e.g. libraries) to produce a complete executable program.

An object code file can contain not only the object code, but also relocation information that the linker uses to assemble multiple object files to form an executable program. It can also contain other information, such as program symbols (names of variables and functions) and debugging (i.e., removing errors) information

An object file format is a format that is used for the storage of object code and related data typically produced by a compiler. There are numerous object file formats. Originally, each type of computer had its own unique object file format, but with the advent of UNIX and other portable operating systems (i.e., operating systems that can be used on different kinds of processors), some formats, such as COFF and ELF, are used on multiple systems.

Created August 7, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.