An application binary interface specifies the conventions that separately compiled program components must share to cooperate at the binary level. It includes a calling convention, representations and layout of data, and platform conventions for object files. A common source-language declaration alone does not ensure that the generated machine instructions agree on where arguments and results reside.
For example, Microsoft's x64 calling convention passes the first two integer arguments in the processor registers RCX and RDX, and returns a suitable scalar integer result in RAX.[ref] A caller placing 7 and 5 in different processor registers from those expected by the called function can obtain the wrong result even if both sides describe an addition function. Matching the application binary interface allows a compiler and hand-written assembly language to cooperate; it does not require them to use the same internal implementation.
Linker (computing) 2026-11-05
A linker (computing) is a program that combines compiled or assembled components and connects references to their definitions. It reads object files and libraries, resolves named symbols, and applies relocation (computing) when locations become known. A typical output is an executable program or a shared software library.[ref]
Suppose one source file calls square and another defines it. Their object files can be produced separately; the linker (computing) matches the call's unresolved symbol to the definition and arranges the final reference. A missing definition can therefore cause a link-time failure even when each source file compiled successfully. Some references can instead be resolved when a shared software library is loaded.
Linking (computing) 2026-11-05
Linking combines separately produced program components and resolves references between them. A linker (computing) reads object files and library archives, assigns or adjusts locations through relocation (computing), and connects references to their definitions. GNU ld describes these as its central operations.[ref]
For example, one object file contains a call to a procedure defined in a second object file. The first compiler invocation can leave a symbolic reference; linking supplies the connection once both components are available. A missing definition or conflicting definitions can cause an error even when both source files compiled separately. Depending on the toolchain, some connections are completed before execution and others when a shared software library is loaded.
Object file 2026-11-05
An object file stores program components produced by a compiler or assembler, together with information needed to combine or load them. A relocatable object file commonly contains machine instructions and data divided into sections, named symbols, and relocation records for references whose final locations are not yet known.[ref]
For example, compiling a file that calls square can produce an object file containing the call-site instruction and an unresolved reference to that symbol. The linker (computing) later supplies its definition from another input. The file thus contains more than the bytes of a self-contained runnable program: its metadata describes how incomplete components fit together.