Difference between revisions of "Relocatable binary"

From Computer History Wiki
Jump to: navigation, search
m (typo)
(how they are relocatable)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Larger programs are usually [[compiler|compiled]] or [[assembler|assembled]] from a series of smaller modules of [[source code]], producing a like number of '''relocatable binary''' modules containing the low-level binary [[instruction]]s and data 'understood' by a given [[Central Processing Unit|CPU]].
+
Larger programs are usually [[compiler|compiled]] or [[assembler|assembled]] from a series of smaller modules of [[source code]], producing a like number of '''relocatable binary''' modules, containing the low-level [[object code|binary]] [[instruction]]s and data 'understood' by a given [[Central Processing Unit|CPU]]. These modules, which can be easily modified to operate at any [[address]] in [[main memory]], can later be [[linking|linked]] together to produce an executable binary object.
 
 
These 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).
 
 
 
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 ('external references') 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's target is to be found.
 
  
 
In addition to the instructions (in binary form) and data, a relocatable binary module contains other information, needed for the linking process. It includes a 'symbol table'; a list of:
 
In addition to the instructions (in binary form) and data, a relocatable binary module contains other information, needed for the linking process. It includes a 'symbol table'; a list of:

Latest revision as of 21:16, 9 October 2022

Larger programs are usually compiled or assembled from a series of smaller modules of source code, producing a like number of relocatable binary modules, containing the low-level binary instructions and data 'understood' by a given CPU. These modules, which can be easily modified to operate at any address in main memory, can later be linked together to produce an executable binary object.

In addition to the instructions (in binary form) and data, a relocatable binary module contains other information, needed for the linking process. It includes a 'symbol table'; a list of:

  • all the names on all out-going references to other modules;
  • the names which this module contains within it;

There is also 'relocation' information, noting the words in this module which need to be modified during the linking process, and exactly what type(s) of modifications are needed for each.