Skip to content
The Computer Science
TheCScience
  • Engineering Subjects
    • Human Values
    • Computer System Architecture
    • Microprocessor
    • Digital Communication
    • Internet of Things
  • NCERT Solutions
    • Class 12
    • Class 11
  • Solutions
    • HackerRank
      • C Solutions
      • C++ Solutions
      • Java Solutions
      • Python Solutions
      • Algorithms Solutions
      • Data Structures Solutions
    • HackerEarth Solutions
    • Leetcode Solutions
  • JEE 2027
The Computer Science
TheCScience

Shared Libraries in Operating Systems | OS Tutorials

YASH PAL, June 14, 2026June 14, 2026

In an operating system, shared libraries, also referred to as dynamic libraries, are linked differently from static libraries. At compile time, the linker ensures that all the necessary symbols are either linked into the executable or can be linked at runtime from the shared library. Executables compiled from shared libraries are smaller, but the shared libraries must be included with the executable to function correctly. When multiple programs use the same shared library, only one copy of the library is required in memory.

Table of Contents

  • Shared Libraries in an Operating System
    • Advantages of Shared Libraries
    • Batch Loader
      • Program Management Loader

Shared Libraries in an Operating System

When creating a shared library with ld, be aware of the following restrictions:

  • Shared libraries must not be linked with archive libraries.
  • When creating a shared library, you can only depend on other shared libraries for resolving external references.
  • If you need to reference a routine that currently resides in an archive library, either put that routine in a separate shared library or include it in the shared library being created.
  • You can specify multiple object (.o) files when creating a shared library.
  • To put a routine in a separate shared library, obtain the source or object file for that routine. Recompile if necessary, and create a separate shared library.
  • To include a routine in the shared library being created, put the routine (source or object file) with other source files that make up the shared library and recompile if necessary.
  • Now create the shared library, making sure that you specify the file containing that routine either during recompilation or when creating the shared library.
  • When creating shared libraries, all symbols must be defined (resolved).
  • Because all symbols must be defined to ID when you create a shared library, you must specify the shared libraries on the ID command line.

Advantages of Shared Libraries

  • Load time might be reduced because the shared library code might already be in memory.
  • Run-time performance can be enhanced because the operating system is less likely to page out shared library code that is being used by several applications, or copies of an application, rather than code that is only being used by a single application. As a result, fewer page faults occur.
  • The routines are not statically bound to the application but are dynamically bound when the application is loaded.
  • This permits applications to automatically inherit changes to the shared libraries without recompiling or rebinding.

Batch Loader

The batch loader combines the basic editing and loading services (which can also be provided by the linkage editor and program manager) into one job step. The batch loader accepts object decks and load modules, and loads them into virtual storage for execution. Unlike the binder and linkage editor, the batch loader does not produce load modules that can be stored in program libraries. The batch loader prepares the executable program in storage and passes control to it directly.

Program Management Loader

  • The program management loader increases the services of the program manager component by adding support for loading program objects.
  • The loader reads both program objects and load modules into virtual storage and prepares them for execution.
  • It resolves any address constants in the program to point to the appropriate areas in virtual storage and supports the 24-bit, 31-bit and 64-bit addressing modes.
engineering subjects Operating System Operating System

Post navigation

Previous post
Next post

Leave a Reply

Your email address will not be published. Required fields are marked *

Engineering Core Subjects

Digital Communication Subject
Internet of Things Subject
Computer Architecture subject
Human Value Subject

JEE Study Materials

JEE Physics Notes
JEE Chemistry Notes

TheCScience

At TheCScience.com, our mission is to make quality education accessible to everyone. We provide in-depth, easy-to-understand articles covering Secondary, Senior Secondary, and Graduation-level subjects.

Pages

About US

Contact US

Privacy Policy

DMCA

Our Tools

Hosting - get 20% off

Engineering Subjects

Internet of Things

Human Values

Digital Communication

Computer System Architecture

Microprocessor

Programming Tutorials

Data Structure and Algorithm

C

Java

NCERT

Class 12th

©2026 TheCScience | WordPress Theme by SuperbThemes