You are on page 1of 5

SYSTEM SOFTWARE

Unit 4: LOADERS AND LINKERS

Book: System Software, 3rd Edition, Pearson Education


By Leland L. Beck & Dhanabalachandran Manjula

1. Explain the design of Absolute loader.

 Define absolute loader.


 Give algorithm and explain.
 Give an example (An object program and loading it into memory).

2. What is the difference in the representation of the assembled code and the code
during loading? Which other representations can be used to store object program?

 Difference: In object program, hexadecimal representation in character


form (i.e., characters 14 occupy two bytes).
In the code during loading, each printed character represents one hex
digit in memory i.e., a half byte. (i.e., characters 14 occupy one byte).
 Other representation available is binary form
 Conclude which representation is efficient. (Refer page 132)

3. How does an absolute loader handle the modification records in an object


program?

 Such loader is used only when there is no need of relocation or the


exact address for loading the object program is known. Hence no
question of modification record.

4. How many passes does an absolute loader require to load an object program into
the memory?

5. If operating system is the first program to be run by the computer, which loader is
needed to load the operating system? Explain the loader with its source code for
SIC/XE machine

 Boot strap loader


 Give source code
 Explain source code
i. The main routine and the program to be loaded.
ii. GETC sub-routine ( Conversion of 2 byte representation in
object program into 1 byte during loading )
6. How does a bootstrap loader differentiate between control bytes (such as end-of-
line) and valid characters to be loaded into memory?

 Explain GETC subroutine where all codes less than hex 30 are skipped
and values above hex 30 are considered valid characters

7. Is Program linking a machine dependent feature of loaders? Justify your answer.

 Program linking is not a machine dependent feature as it is independent of


machine architecture. However, linking usually involves relocation of
some of the routines to be linked together and relocation is a machine
dependent feature of loaders.

8. Give the machine dependent feature of loaders.

 Relocation

9. Explain relocation as a machine dependent feature of loaders.

 Need for relocation of object program.


 Give two methods for specifying relocation and briefly explain
i. Using modification record ( SIC/XE ).
ii. Using bit mask technique ( SIC ).
 Explain the need of two different methods because of different machine
architectures.

10. Which relocation method is used for specifying relocation as a part of SIC/XE
object program during loading? Give the SIC/XE relocation loader algorithm and
explain the same.

 A modification record is used to describe each part of the object code that
must be changed when the program is relocated.(Refer page 136 and fig
3.5)
 Give algorithm and explain

11. Which relocation method is used for specifying relocation as a part of SIC object
program during loading? Give the SIC relocation loader algorithm and explain the
same. Justify the reason for choosing this method for specifying relocation in SIC
object programs during loading.

 No modification record is used. Each text record is associated with a


relocation bit (bit masking technique). (Refer page 138 and fig 3.8)
 Give algorithm and explain
12. What is a relative loader? Explain the two methods of specifying relocation as a
part of object program.

 Define relocating loader.


 Explain modification record method and bit masking method with
algorithms ( depending on marks allotted)

13. Explain the procedure of program linking when sub-programs use external
reference.

 Define program linking and say why it is required.


 Take an example with at least two programs, separately compiled with
external reference and explain how they are linked.

14. How are external definition and external reference specified in an object
program? Explain how actual address is calculated during loading?

 Using D and R records (see fig. 3.11) and also explain how they are
specified in modification record
 Explain the calculation of actual address of a label externally referred.
(see fig. 3.12(b))

15. What is a linking loader? Justify why it is a two pass loader.


 Define linking loader
 Refer page 148 for justification.

16. Explain the data structures used in linking loader.

17. Explain the pass 1 of linking loader. What does ESTAB contain at the end of pass
1?

18. What is a load map and where is it used? Give an example of a load map.
 Define load map.
 Its is used in program debugging
 Refer page 149

19. Is the algorithm for linking loader completely efficient? Justify your answer.
 Its not very efficient algorithm. However a slight change to object
program format will make the algorithm more efficient.
 It is because in object program we use names of symbols referenced
externally in object code.

20. Is it possible to increase the efficiency of the linking loader algorithm? If so, how
can it be done?
 Yes.
 It can be done using reference numbers. (For explanation refer page 152
n153)

21. Explain the use of reference numbers in modification record. How does it change
the object program format? Explain with an example.

 Say what reference numbers are and why they are used.
 Take an example and show the object code format used.
 Also explain how it will affect the efficiency of the linking loader
algorithm

22. Explain automatic library search/ automatic library call. Give the role of ESTAB
in automatic library search.
23. How can we override the standard sub routines in library? Explain with an
example.
24. In which case library search can be inefficient? Explain how this inefficiency can
be overcome.
25. Explain the loader options with example.
26. Can a programmer specify his own library? If yes, how can it be done?
27. With an example explain how a loader can be instructed not to resolve references
to some sub-routines during library search.
28. What is a load module or an executable image? How is it produced?

 Load module or Executable image is the linked version of the program


which is written to a file or library. A linkage editor produces a load
module.

29. Explain the difference between the linking loader and linkage editor. Analyze
which one is more efficient.
30. Explain with examples how the loader options can be used in a load module or
executable image to replace a linked subroutine.
31. What is dynamic linking/dynamic loading/load on call? What are the advantages
of dynamic linking? Explain with example.
32. Bootstrap loader is the first program to be executed on start up in a machine.
What are the different ways of accomplishing this?
33. Explain the MS-DOS linker for Pentium and other x86 systems.
34. Explain the MS-DOS object module. How does MS-DOS LINK combine two or
more object modules to produce a complete executable program?

 Give MS-DOS object module in Fig 3.17 and explain


 Explain pass 1 and pass 2 of LINK to produce the executable.

35. What are the different types of linkers provided by SunOS? Explain the different
types of linkers.
36. Explain the Cray MPP linker.

You might also like