Learning path

Full curriculum

Full curriculum

Unit content

Executable loading and dynamic libraries

A linked executable is still only a file until the operating system creates a process from it.

Loading an executable

The operating system reads the executable format, maps code and data into a new process address space, prepares runtime state such as the stack and transfers control to an entry point.

The program's startup code then performs language/runtime initialization before calling the application entry function.

Shared libraries

Instead of copying every library into every executable, a program can refer to shared libraries that are loaded into the process at run time.

A dynamic linker resolves the required library symbols and relocations according to the executable format and platform rules.

Build-time versus run-time failures

Static linking problems appear while building. Dynamic-library problems can instead appear when the program starts because the required library cannot be found or provides an incompatible interface.

File, program and process

Source code is a human-oriented representation, object code is a partially linked machine representation, an executable is a persistent file describing a runnable program, and a process is a live execution with its own runtime state.

Keeping these stages distinct clarifies what the compiler, linker and operating system each contribute.