Free Study, System Programming

Relocation of Linking Concept | System Programming

Relocation: Linking Concept

Again Freestudy9 comes with new post related to Relocation: Linking Concept. Additionally, we had made it with a point to point information as possible as easy.

Relocation: Linking Concept

  • Moreover, Program relocation is the process of modifying the addresses used in the address sensitive instruction of a program such that the program can execute correctly from the designated area of memory.
  • If linked origin? translated origin, relocation must perform by the linker.
  • If load origin? linked origin, relocation must perform by the loader.
  • Similarly, Let AA be the set of absolute address – instruction or data addresses – used in the instruction of a program P.
  • AA ? ? implies that program P assumes its instructions. And also, data to occupy memory words with specific addresses.
  • Such a program – called an address sensitive program – contains one or more of the following:
    o An address sensitive instruction: an instruction which uses an address an I e AA.
    o An address constant: a data word which contains an address an I e AA.
  • Also, An address sensitive program P can execute correctly only if the start address of the memory area allocated to it is the same as its translated origin.
  • Moreover, To execute correctly from any other memory area, the address used in each address sensitive instruction of P must ‘corrected’.
 Performing relocation | Relocation: Linking Concept
  • Let the translated and linked origins of program P be t_originp and l_originp, respectively.
  • Consider a symbol symb in P.
  • Let its translation time address be tsymb and link time address limb.
  • Moreover, The relocation factor of P defined as
  • Relocation _factorp =l_originp-t_originp…..(1)
  • Note that relocation_factorp can be positive, negative or zero.
  • Moreover, Consider a statement which uses symb as an operand. The translator puts the address tsymb in the instruction generated for it. Now,
  • Tsymb = t_originp + dsymb
  • Where dsyml_b the offset of symb in P. Hence
  • lsymb = l_originp + dsymb
  • Using (1),
  • lsymb = t_originp + Relocation _factorp + dsymb
  •                    = t_originp + dsymb + Relocation _factorp
  •                    = tsymb + Relocation _factorp…..(2)
  • Let IRPp designate the set of instructions requiring relocation in program P. Following (2), relocation of program P can be performed by computing the relocation factor for P and adding it to the translation time address(es) in every instruction I e IRPp.
Linking | Relocation: Linking Concept
  • Consider an application program AP consisting of a set of program units SP = {P i}.
  • A program unit Pi interacts with another program unit Pj by using addresses of Pj’s instructions. And also, data in its own instructions.
  • Moreover, To realize such interactions, Pj and Pi must contain public definitions and external references as defined in the following: (Explain public definition and external reference)
    o Public definition: a symbol pub_symb defined in a program unit which may reference in other program units.
    o External reference: a reference to a symbol ext_symb which not defined in the program unit

Related Terms

System programmingMacro preprocessors, Macro Processor Design OptionsCompiler design, Study material, Free study.

 

Tagged ,

Leave a Reply

Your email address will not be published. Required fields are marked *