Shared Object Files

Overview

A shared object file is a special type of relocatable object file that, at runtime, can be loaded into an arbitrary memory location and linked with a program in memory.

dynamic-linking-overview.png

Position-Independent Code

Code that can be executed correctly regardless of its memory address at runtime is called position-independent code (PIC). Generally speaking, it avoids absolute addresses in favor of relative addressing.

Global Offset Table

The global offset table (GOT) exists in the data segment. It contains an 8-byte entry for each global data object (procedure or global variable) referenced by the object module.

Procedure Linkage Table

The procedure linkage table (PLT) exists in the code segment. It is used to enable lazy binding of function calls, deferring the binding of each procedure address until the first time the procedure is called.

Powered by Forestry.md