Os Presentation
Os Presentation
SCHEMES
PRESENTED BY :-
ANAND KUMAR(10009_B1)
ANSHUL PRATAP SINGH(10015_B1)
KAUSHAL KUMAR(10051_B1)
NAVNEET SHARMA(10066_B1)
ANSHUL SINGH(10016_B1)
What is Linking & Linker ?
Static Linker:
Embeds all required code from libraries into
the executable during compile time.
Dynamic Linker:
Linksshared libraries at runtime, making the
executable smaller and more flexible.
TYPES OF LINKING
DYNAMIC LINKING
COMPILE-TIME LINKING
Compile-time linking, also known as static linking, is the process where
all the required object files and libraries are combined into a single
executable file during the compilation phase.
Faster Execution:
Since all linking is done beforehand, there is no need
to resolve references at runtime.
Portability:
The executable can run independently without
relying on external libraries.
Simplified Deployment:
No need to ensure the availability of dynamic
libraries on the target machine.
Disadvantages
Larger Executable Size:
All library functions are included, even if some are not
used.
Inflexibility:
Updating a library requires recompiling the entire
program.
Higher Memory Usage:
Multiple programs using the same library will each
include their own copy of the library, leading to
redundancy.
LOAD-TIME LINKING
Load-time linking is the process of resolving external references in
a program when it is loaded into memory for execution. Unlike
compile-time linking, which occurs before execution, load-time
linking delays the linking process until just before the program
starts running.
How Load-Time Linking Works ?
Compilation:
The compiler converts source code into object files (.o, .obj).
These object files contain placeholders for external references
(e.g., library functions).
Partial Linking:
The linker generates an intermediate program (not fully resolved),
leaving unresolved references for later.
Loading:
When the program is loaded into memory, the operating system's
loader resolves the unresolved references by linking them to the
Advantages
Memory Efficiency:
Shared libraries are loaded only once and can
be shared by multiple programs.
Reduced File Size:
The executable does not contain library code,
making it smaller than a statically linked
program.
Flexibility:
Librariescan be updated without recompiling
the program, as long as the interface remains
consistent.
Disadvantages