Difference between revisions of "Relocatable binary"

From Computer History Wiki
Jump to: navigation, search
m (avoid redir)
m (av)
Line 1: Line 1:
Larger programs are [[compiler|compiled]] or [[assembler|assembled]] from a series of smaller modules of [[source code]], producing '''relocatable binary''' modules of the low-level binary 'understood' by a given [[CPU]], which are then '''linked''' together to produce an [[object code|executable binary]] object.
+
Larger programs are [[compiler|compiled]] or [[assembler|assembled]] from a series of smaller modules of [[source code]], producing '''relocatable binary''' modules of the low-level binary 'understood' by a given [[Central Processing Unit|CPU]], which are then '''linked''' together to produce an [[object code|executable binary]] object.
  
 
This involves two logical stages (although often the the software doing the linking, the '''linker''', merges them together, in actual operation).
 
This involves two logical stages (although often the the software doing the linking, the '''linker''', merges them together, in actual operation).

Revision as of 20:39, 21 September 2017

Larger programs are compiled or assembled from a series of smaller modules of source code, producing relocatable binary modules of the low-level binary 'understood' by a given CPU, which are then linked together to produce an executable binary object.

This involves two logical stages (although often the the software doing the linking, the linker, merges them together, in actual operation).

In the first, the linker must pick an address at which to place each binary module, and modify the binary of each module to function at that address.

The second stage is one in which references from one module to names in another are 'resolved', and the binary in the module which is making the 'external' reference is modified to properly refer to the location in the module where the reference is to be found.

In addition to the instructions (in binary form), a relocatable binary module contains other information, needed for the linking process. It includes a 'symbol table' (a list of i) all the names on all out-going references to other modules, and ii) the names which this module contains within it); and also 'relocation' information, noting the words in this module which need to be modified during the linking process, and what exactly what type(s) of modifications are needed for each.