Dynamic Linking and
Loading
Linking:
Combining a set of programs, including library
routines, to create a loadable image.
Properties:
a) Resolving symbols defined within the set.
b) Listing symbols needing to be resolved by loader.
Loading:
Copying the loadable image into memory, connecting
it with any other programs already loaded, and
updating addresses as needed.
Properties
a) Interpreting file to initialize the process address
space.
Dynamic Linking:
1. Complete linking postponed until execution time.
2. Operating system needs to check if routine is in
processes memory address space.
3. Dynamic linking is particularly useful for libraries.
Dynamic Loading:
1. Routine is not loaded until it is called.
2. Better memory-space utilization, unused routine is
never loaded.
3. Useful when large amounts of code are needed to
handle infrequently occurring cases.
Summary:
1. It is a special part of the OS that loads external shared libraries into a
running process and then binds those shared library dynamically to the
running process.
2. It helps in not loading the entire library for execution.
3. It is used to load into main memory.
4. It provides the ability to load the subroutine only when they are needed,
so lot of time and memory is saved if subroutines are very large or with
lot of external references.