14.2. Dynamic Linking

A dynamically linked application is comprised of two primary object file components: dynamic link libraries (DLLs) and dynamic executables. Each of these components can be loaded to a target memory address of the dynamic loader’s choosing.

  • Dynamic Link Libraries (DLLs) - are individual ELF object files that contain functions and data objects meant to be used by other ELF files. In a dynamic application, this means they may be used by dynamic executables or other DLLs. A DLL is not intended to be executable on its own.

  • Dynamic Executables - are very much like a static executable, except that they are not typically tied to a specific target memory address and they may depend on one or more DLLs to resolve references to symbols that are not defined in the dynamic executable ELF object file itself.

When building a dynamic application, one must start with building the DLLs that do not depend on other DLLs, then build the DLLs that have dependencies on other DLLs, then finally build the dynamic executable that may depend on one or more DLLs.

Once the dynamic application is built, a dynamic loader with special capabilities is needed to load and run the application. These special capabilities are described in more detail in the Support Responsibilities of the Dynamic Loader section.