Linking (computing) (source code)

= Linking
{disambiguate=computing}

<Linking (computing)> 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.<Overview in the GNU ld documentation>[§1, combining object/archive files, relocating data and resolving symbol references]{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 (computing)> 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.