All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Understanding Load-Time Relocation of Shared Libraries in Modern Operating Systems

By

saltypal

7mo ago· 12 min readen

Summary

This technical article explains how modern operating systems implement load-time relocation for shared libraries, focusing on Linux OS running on 32-bit x86 architecture. It covers the fundamental principles of shared library loading, address space layout randomization (ASLR), position-independent code (PIC), and the mechanisms that allow multiple processes to share the same library code while having different data segments. The article discusses the technical challenges of memory management, relocation entries, and how operating systems handle the mapping of shared libraries into process address spaces at load time.

Key quotes

· 4 pulled
This article's aim is to explain how a modern operating system makes it possible to use shared libraries with load-time relocation.
It focuses on the Linux OS running on 32-bit x86, but the general principles apply to other OSes and CPUs as well.
Note that shared libraries have many names - shared libraries, shared objects, dynamic shared objects (DSOs), dynamically linked libraries (DLLs - if you're coming from a Windows background).
For the sake of consistency, I will try to just use the name 'shared library' throughout.
Snippet from the RSS feed
This article's aim is to explain how a modern operating system makes it possible to use shared libraries with load-time relocation. It focuses on the Linux OS running on 32-bit x86, but the general principles apply to other OSes and CPUs as well.

You might also wanna read