Page 125 - DCAP507_SYSTEM_SOFTWARE
P. 125

Unit 8: Introduction to Linking and Loading




          The output of translator is a program known as object module. The linker processes these object  Notes
          modules binds with essential library routines and makes a ready to implement program. Such
          a program is known as binary program. The "binary program also comprises some necessary
          information regarding allocation and relocation. The loader then loads this program into memory
          for implementation reason.
                                  Figure 8.4:  Process of  Linking a  Process

























          Different tasks of linker are:
          1.   Prepare a single load module and regulate all the addresses and subroutine references
               with respect to the offset position.

          2.   To prepare a load module concatenate all the object modules and regulate all the operand
               address references in addition to external references to the offset position.
          3.   At accurate locations in the load module, copy the binary machine instructions and constant
               data so as to prepare ready to implement module.
          The linking process is done in two passes. Two passes are essential since the linker may encounter
          a forward reference before recognizing its address. So it is essential to scan all the DEFINITION
          and USE table at least once. Linker then builds the Global symbol table with the help of USE and
          DEFINITION table. In Global  symbol table name of every externally  referenced symbol is
          involved along with its address relative to starting of the load module. And throughout pass 2,
          the addresses  of external references are  substituted by attaining the  addresses from global
          symbol  table.

          8.2.3  Loaders

          As we turn on the computer there is nothing significant in the main memory (RAM). A small
          program is written  and amassed in the ROM. This program primarily loads the  operating
          system from secondary storage to main memory. The operating system then takes the on the
          whole control. This program which is accountable for booting up  the system  is known as
          bootstrap loader.


               !
             Caution  This is the program which must be implemented first when the system is first
             powered on.



                                           LOVELY PROFESSIONAL UNIVERSITY                                   119
   120   121   122   123   124   125   126   127   128   129   130