SlideShare a Scribd company logo
MODULE 3
Loading, linking and relocating Loader schemes-
Binders, linking loaders, overlays, dynamic binders
Dynamic loading and dynamic linking – Relocatability
of prog
LOADING
• It is a special program that takes the input of executable files from
the linker, loads it to the main memory, and prepares this code for
execution by a computer.
• In a computer operating system , a loader is a component that locates
a given program in offline storage (such as a hard disk ), loads it into
main storage, and gives that program control of the computer.
• A loader is a major component of an operating system that ensures all
necessary programs and libraries are loaded, which is essential during
the startup phase of running a program.
LINKING
• The job of the linker is to combine these object files and, in the
process, to resolve all of the unresolved symbols.
• The output of the linker is a new object file that contains all of the
code and data from the input object files and is in the same object file
format.
• If the same symbol is declared in more than one object file, the linker
is unable to proceed. It will likely complain to the programmer (by
displaying an error message) and exit.
• if a symbol reference remains unresolved after the entire object
files have been merged, the linker will try to resolve the reference on
its own.
RELOCATING
• A relocating loader load a program in a designated area of memory,
relocates it so that it can execute correctly in that area of memory
and passes control to it for execution.
• The binary program is stored in a file contains the following:
A Header record showing the load origin, length and load time
execution start address of the program.
A sequence of binary image records containing the program’s code.
Each binary image record contains a part of the program’s code in the
form of a sequence of bytes, the load address of the first byte of this
code and a count of the number of bytes of code.
A table analogous to RELOCTAB table giving linked addresses of
address sensitive instructions in the program.
Relocating Linking Loaders
• Relocating linking loader combines together the relocating
capabilities of relocating loaders and the advanced linking features of
linking loaders and presents a more robust loading scheme.
• This necessarily eliminates the need to use two separate programs
for linking and loading respectively.
• Moreover, these loaders can perform relocation and be linking both.
• Similarly, these loaders can work efficiently with support from the
operating system and utilize the memory and other resources
efficiently.
• LOADER SCHEMES
1. Compile-and-Go Loaders
• Assembler is loaded in one part of memory and assembled program
directly into their assigned memory location.
• After the loading process is complete, the assembler transfers the
control to the starting instruction of the loaded program.
Advantages
• The user need not be concerned with the separate steps of
compilation, assembling, linking, loading, and executing.
• Execution speed is generally much superior to interpreted systems.
• They are simple and easier to implement.
Disadvantages
• There is wastage in memory space due to the presence of the
assembler.
• The code must reprocess every time it runs.
2. General Loader Schemes
• The general loading scheme improves the compile/assemble-and-go
scheme by allowing different source programs (or modules of the
same program) to be translated separately into their respective object
programs.
• Moreover, the object code (modules) stored in the secondary storage
area; and then, they are loaded.
• Similarly, The loader usually combines the object codes and executes
them by loading them into the memory.
The loader program is comparatively much smaller than the
assembler, hence making more space available to the user for their
programs.
System software module 3 presentation file
Advantages of the general loading scheme:
• Saves memory and makes it available for the user program as loaders are
smaller in size than assemblers. The loader replaces the assembler.
• Similarly, Reassembly of the program no more needed for later execution
of the program. The object file/deck available and can load and executed
directly at the desired location.
• This scheme allows the use of subroutines in several different languages
because the object files processed by the loader utility will all be in
machine language.
Disadvantages of the general loading scheme:
• Moreover, the loader more complicated and needs to manage multiple
object files.
• Secondary storage required to store object files, and they cannot directly
place into the memory by assemblers.
3) Absolute Loader:
• Absolute loader is a kind of loader in which relocated object files are
created, loader accepts these files and places them at specified
locations in the memory.
• This type of loader is called absolute because no relocation
information is needed; rather it is obtained from the programmer or
assembler.
Thus the absolute loader is simple to implement in this scheme
1. Allocation is done by either programmer or assembler
2. Linking is done by the programmer or assembler
3. Relocation is done by assembler
4. Simply loading is done by the loader
Advantages:
1. It is simple to implement
2. This scheme allows multiple programs or the source programs
written different languages.
3. The task of loader becomes simpler as it simply obeys the instruction
regarding where to place the object code in the main memory.
4. The process of execution is efficient.
Disadvantages:
1. In this scheme it is the programmer's duty to adjust all the inter
segment addresses and manually do the linking activity. For that, it
is necessary for a programmer to know the memory management.
LINKING LOADERS
• Special system program called linking loader gathers various object
modules, links them together to produce single executable binary
program and loads them into the memory.
• This category of loaders leads to a popular class of loaders called
direct-linking loaders.
• Moreover, The loaders used in these situations are usually called
linking loaders, which link the necessary library functions and
symbolic references.
• Essentially, linking loaders accept and link together a set of object
programs and a single file to load them into the core.
• Similarly, Linking loaders additionally perform relocation and
overcome disadvantages of other loading schemes.
BINDERS
• In file management, a binder is a software utility that combines two
or more files into a single file.
• The program which performs allocation, relocation and linking is
called binder.
• The binder performs relocation, creates linked executable text and
stores this text in a file in some systematic manner.
• Such kind of module prepared by the binder execution is called load
module.
• This load module can then be actually loaded in the main memory
by the loader.
• This loader is also called as module loader.
• If the binder can produce the exact replica of executable code in the
load module then the module loader simply loads this file into the
main memory which ultimately reduces the overall time complexity.
• But in this process the binder should knew the current positions of
the main memory.
• The binder which performs the linking function and produces
adequate information about allocation and relocation and writes this
information along with the program code in the file is called linkage
editor.
• The module loader then accepts this file as input, reads the
information stored in and based on this information about allocation
and relocation it performs the task of loading in the main memory.
• Even though the program is repeatedly executed the linking is done
only once.
• Moreover, the flexibility of allocation and relocation helps efficient
utilization of the main memory.
DYNAMIC BINDERS
• A binding is dynamic if it occurs during execution or can change
during execution of the program.
• A binding is static if it occurs before run time and remains
unchanged throughout program execution.
• Dynamic binding also called dynamic dispatch, is the process of
linking procedure call to a specific sequence of code (method) at run-
time.
• It means that the code to be executed for a specific procedure call is
not known until run-time.
• Dynamic binding is also known as late binding or run-time binding.
DYNAMIC LOADING
• Dynamic loading refers to the process of loading a program into the main
memory on demand.
• In Dynamic Loading, a routine is not loaded until it is called.
• Better memory-space utilization; unused routine is never loaded.
• Useful when large amounts of code are needed to handle infrequently
occurring cases. No special support from the operating system is required
implemented through program design.
• When dynamic loading is used, dynamic linking is used as well.
• The processing speed of dynamic loading is slower because the files are
uploaded at processing time.
DYNAMIC LINKING
• The process of linking external libraries and references at runtime,
when the program is loaded or executed.
• Linkage editors perform linking operations before the program is
loaded for execution.
• Dynamic linking is often used to allow several executing programs to
share one copy of a subroutine or library.
• With a program that allows its user to interactively call any of the
subroutines of a large mathematical and statistical library, all of the
library subroutines could potentially be needed, but only a few will
actually be used in any one execution.
• Dynamic linking can avoid the necessity of loading the entire library
for each execution except those necessary subroutines.
• Dynamically linked shared libraries are easier to create than static
linked shared libraries.
• Dynamically linked shared libraries are easier to update than static
linked shared libraries.
• Slightly slower program startup due to the additional linking process,
but overall performance impact is minimal.
OVERLAYS
• In memory management, overlays refer to a technique used to manage
memory efficiently by overlaying a portion of memory with another
program or data.
• In a general computing sense, overlaying means "the process of
transferring a block of program code or other data into internal memory,
replacing what is already stored".
• Overlaying is a programming method that allows programs to be larger
than the computer's main memory.
• Overlays keep in memory only those instructions and data that are
needed at any given time.It needed when process is larger than amount
of memory allocated to it.
• This is implemented by user, no special support needed from operating
system, programming design of overlay structure is complex.
RELOCATABILITY OF PROGRAMS.
• A relocatable program is one that can be read into memory at any
address and executed without modification.
• It can be loaded at-most anywhere in the memory
• This mainly means using relative offsets for data accesses and jump
instructions.
• If this is easy/possible is based on the type of architecture, the size
of the address space and the size of the program.
• A Relocatable program form is one which consists of a program and
relevant information for its relocation.
• Using this information it is possible to relocate the program to
execute from a storage area then the one designated for it at the time
of its coding or translation.
• A Non Relocatable program is one which cannot be made to
execute in any area of storage other than the one designated for it at
the time of its coding or translation.
***************************

More Related Content

PPTX
Linker and Loader
PPTX
linker & loader presentation in Compiler Design
PDF
loaders and linkers
PPT
Loaders and Linkers
PDF
Unit 3
PPTX
Loader and Its types
PPTX
Ch 4 linker loader
Linker and Loader
linker & loader presentation in Compiler Design
loaders and linkers
Loaders and Linkers
Unit 3
Loader and Its types
Ch 4 linker loader

Similar to System software module 3 presentation file (20)

PPTX
Loaders ( system programming )
PPTX
PPT
Loaders complete
PPTX
SPOS UNIT 3 notes SPOS UNIT 3 notes SPOS UNIT 3 notes
PDF
loaders-and-linkers.pdfhhhhhccftyghgfggy
PPTX
Linkers
PPTX
Linkers in compiler
PPT
Mod 5.3 - Linkers & Loaderss Summary.ppt
PPT
loaderfffffffffffffffffffffffffffflinker.ppt
PDF
system prgramming - loaders-linkers.pdf
PDF
Address Binding Scheme
PPT
PPT
assem.ppt
DOCX
Loaders
PPT
Os7 2
PPTX
Introduction to loaders
PPT
Overall 23 11_2007_hdp
PPT
System software-loaders
PDF
Hm system programming class 1
PPTX
Loader and linker.pptx
Loaders ( system programming )
Loaders complete
SPOS UNIT 3 notes SPOS UNIT 3 notes SPOS UNIT 3 notes
loaders-and-linkers.pdfhhhhhccftyghgfggy
Linkers
Linkers in compiler
Mod 5.3 - Linkers & Loaderss Summary.ppt
loaderfffffffffffffffffffffffffffflinker.ppt
system prgramming - loaders-linkers.pdf
Address Binding Scheme
assem.ppt
Loaders
Os7 2
Introduction to loaders
Overall 23 11_2007_hdp
System software-loaders
Hm system programming class 1
Loader and linker.pptx
Ad

Recently uploaded (20)

PDF
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PDF
YOW2022-BNE-MinimalViableArchitecture.pdf
PPTX
AD Bungalow Case studies Sem 2.pptxvwewev
PPTX
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
PDF
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
PDF
Urban Design Final Project-Context
PDF
GREEN BUILDING MATERIALS FOR SUISTAINABLE ARCHITECTURE AND BUILDING STUDY
PDF
Facade & Landscape Lighting Techniques and Trends.pptx.pdf
PPTX
areprosthodontics and orthodonticsa text.pptx
DOCX
The story of the first moon landing.docx
PDF
Trusted Executive Protection Services in Ontario — Discreet & Professional.pdf
PDF
SEVA- Fashion designing-Presentation.pdf
PPTX
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
PPTX
12. Community Pharmacy and How to organize it
PPT
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
PPT
Machine printing techniques and plangi dyeing
PPTX
6- Architecture design complete (1).pptx
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PPTX
Special finishes, classification and types, explanation
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
YOW2022-BNE-MinimalViableArchitecture.pdf
AD Bungalow Case studies Sem 2.pptxvwewev
Complete Guide to Microsoft PowerPoint 2019 – Features, Tools, and Tips"
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
Urban Design Final Project-Context
GREEN BUILDING MATERIALS FOR SUISTAINABLE ARCHITECTURE AND BUILDING STUDY
Facade & Landscape Lighting Techniques and Trends.pptx.pdf
areprosthodontics and orthodonticsa text.pptx
The story of the first moon landing.docx
Trusted Executive Protection Services in Ontario — Discreet & Professional.pdf
SEVA- Fashion designing-Presentation.pdf
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
12. Community Pharmacy and How to organize it
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
Machine printing techniques and plangi dyeing
6- Architecture design complete (1).pptx
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
Special finishes, classification and types, explanation
Ad

System software module 3 presentation file

  • 1. MODULE 3 Loading, linking and relocating Loader schemes- Binders, linking loaders, overlays, dynamic binders Dynamic loading and dynamic linking – Relocatability of prog
  • 2. LOADING • It is a special program that takes the input of executable files from the linker, loads it to the main memory, and prepares this code for execution by a computer. • In a computer operating system , a loader is a component that locates a given program in offline storage (such as a hard disk ), loads it into main storage, and gives that program control of the computer. • A loader is a major component of an operating system that ensures all necessary programs and libraries are loaded, which is essential during the startup phase of running a program.
  • 3. LINKING • The job of the linker is to combine these object files and, in the process, to resolve all of the unresolved symbols. • The output of the linker is a new object file that contains all of the code and data from the input object files and is in the same object file format. • If the same symbol is declared in more than one object file, the linker is unable to proceed. It will likely complain to the programmer (by displaying an error message) and exit. • if a symbol reference remains unresolved after the entire object files have been merged, the linker will try to resolve the reference on its own.
  • 4. RELOCATING • A relocating loader load a program in a designated area of memory, relocates it so that it can execute correctly in that area of memory and passes control to it for execution. • The binary program is stored in a file contains the following: A Header record showing the load origin, length and load time execution start address of the program. A sequence of binary image records containing the program’s code. Each binary image record contains a part of the program’s code in the form of a sequence of bytes, the load address of the first byte of this code and a count of the number of bytes of code. A table analogous to RELOCTAB table giving linked addresses of address sensitive instructions in the program.
  • 5. Relocating Linking Loaders • Relocating linking loader combines together the relocating capabilities of relocating loaders and the advanced linking features of linking loaders and presents a more robust loading scheme. • This necessarily eliminates the need to use two separate programs for linking and loading respectively. • Moreover, these loaders can perform relocation and be linking both. • Similarly, these loaders can work efficiently with support from the operating system and utilize the memory and other resources efficiently.
  • 6. • LOADER SCHEMES 1. Compile-and-Go Loaders • Assembler is loaded in one part of memory and assembled program directly into their assigned memory location. • After the loading process is complete, the assembler transfers the control to the starting instruction of the loaded program.
  • 7. Advantages • The user need not be concerned with the separate steps of compilation, assembling, linking, loading, and executing. • Execution speed is generally much superior to interpreted systems. • They are simple and easier to implement. Disadvantages • There is wastage in memory space due to the presence of the assembler. • The code must reprocess every time it runs.
  • 8. 2. General Loader Schemes • The general loading scheme improves the compile/assemble-and-go scheme by allowing different source programs (or modules of the same program) to be translated separately into their respective object programs. • Moreover, the object code (modules) stored in the secondary storage area; and then, they are loaded. • Similarly, The loader usually combines the object codes and executes them by loading them into the memory. The loader program is comparatively much smaller than the assembler, hence making more space available to the user for their programs.
  • 10. Advantages of the general loading scheme: • Saves memory and makes it available for the user program as loaders are smaller in size than assemblers. The loader replaces the assembler. • Similarly, Reassembly of the program no more needed for later execution of the program. The object file/deck available and can load and executed directly at the desired location. • This scheme allows the use of subroutines in several different languages because the object files processed by the loader utility will all be in machine language. Disadvantages of the general loading scheme: • Moreover, the loader more complicated and needs to manage multiple object files. • Secondary storage required to store object files, and they cannot directly place into the memory by assemblers.
  • 11. 3) Absolute Loader: • Absolute loader is a kind of loader in which relocated object files are created, loader accepts these files and places them at specified locations in the memory. • This type of loader is called absolute because no relocation information is needed; rather it is obtained from the programmer or assembler.
  • 12. Thus the absolute loader is simple to implement in this scheme 1. Allocation is done by either programmer or assembler 2. Linking is done by the programmer or assembler 3. Relocation is done by assembler 4. Simply loading is done by the loader Advantages: 1. It is simple to implement 2. This scheme allows multiple programs or the source programs written different languages. 3. The task of loader becomes simpler as it simply obeys the instruction regarding where to place the object code in the main memory. 4. The process of execution is efficient.
  • 13. Disadvantages: 1. In this scheme it is the programmer's duty to adjust all the inter segment addresses and manually do the linking activity. For that, it is necessary for a programmer to know the memory management.
  • 14. LINKING LOADERS • Special system program called linking loader gathers various object modules, links them together to produce single executable binary program and loads them into the memory. • This category of loaders leads to a popular class of loaders called direct-linking loaders. • Moreover, The loaders used in these situations are usually called linking loaders, which link the necessary library functions and symbolic references. • Essentially, linking loaders accept and link together a set of object programs and a single file to load them into the core. • Similarly, Linking loaders additionally perform relocation and overcome disadvantages of other loading schemes.
  • 15. BINDERS • In file management, a binder is a software utility that combines two or more files into a single file. • The program which performs allocation, relocation and linking is called binder. • The binder performs relocation, creates linked executable text and stores this text in a file in some systematic manner. • Such kind of module prepared by the binder execution is called load module. • This load module can then be actually loaded in the main memory by the loader. • This loader is also called as module loader.
  • 16. • If the binder can produce the exact replica of executable code in the load module then the module loader simply loads this file into the main memory which ultimately reduces the overall time complexity. • But in this process the binder should knew the current positions of the main memory. • The binder which performs the linking function and produces adequate information about allocation and relocation and writes this information along with the program code in the file is called linkage editor.
  • 17. • The module loader then accepts this file as input, reads the information stored in and based on this information about allocation and relocation it performs the task of loading in the main memory. • Even though the program is repeatedly executed the linking is done only once. • Moreover, the flexibility of allocation and relocation helps efficient utilization of the main memory.
  • 18. DYNAMIC BINDERS • A binding is dynamic if it occurs during execution or can change during execution of the program. • A binding is static if it occurs before run time and remains unchanged throughout program execution. • Dynamic binding also called dynamic dispatch, is the process of linking procedure call to a specific sequence of code (method) at run- time. • It means that the code to be executed for a specific procedure call is not known until run-time. • Dynamic binding is also known as late binding or run-time binding.
  • 19. DYNAMIC LOADING • Dynamic loading refers to the process of loading a program into the main memory on demand. • In Dynamic Loading, a routine is not loaded until it is called. • Better memory-space utilization; unused routine is never loaded. • Useful when large amounts of code are needed to handle infrequently occurring cases. No special support from the operating system is required implemented through program design. • When dynamic loading is used, dynamic linking is used as well. • The processing speed of dynamic loading is slower because the files are uploaded at processing time.
  • 20. DYNAMIC LINKING • The process of linking external libraries and references at runtime, when the program is loaded or executed. • Linkage editors perform linking operations before the program is loaded for execution. • Dynamic linking is often used to allow several executing programs to share one copy of a subroutine or library. • With a program that allows its user to interactively call any of the subroutines of a large mathematical and statistical library, all of the library subroutines could potentially be needed, but only a few will actually be used in any one execution. • Dynamic linking can avoid the necessity of loading the entire library for each execution except those necessary subroutines.
  • 21. • Dynamically linked shared libraries are easier to create than static linked shared libraries. • Dynamically linked shared libraries are easier to update than static linked shared libraries. • Slightly slower program startup due to the additional linking process, but overall performance impact is minimal.
  • 22. OVERLAYS • In memory management, overlays refer to a technique used to manage memory efficiently by overlaying a portion of memory with another program or data. • In a general computing sense, overlaying means "the process of transferring a block of program code or other data into internal memory, replacing what is already stored". • Overlaying is a programming method that allows programs to be larger than the computer's main memory. • Overlays keep in memory only those instructions and data that are needed at any given time.It needed when process is larger than amount of memory allocated to it. • This is implemented by user, no special support needed from operating system, programming design of overlay structure is complex.
  • 23. RELOCATABILITY OF PROGRAMS. • A relocatable program is one that can be read into memory at any address and executed without modification. • It can be loaded at-most anywhere in the memory • This mainly means using relative offsets for data accesses and jump instructions. • If this is easy/possible is based on the type of architecture, the size of the address space and the size of the program.
  • 24. • A Relocatable program form is one which consists of a program and relevant information for its relocation. • Using this information it is possible to relocate the program to execute from a storage area then the one designated for it at the time of its coding or translation. • A Non Relocatable program is one which cannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation.