4.1. Dynamic linking concepts

A dynamic application normally consists of an executable and a number of modules. The modules are normally referred to as either a shared library, dynamic link library (DLL) or dynamic shared object (DSO), depending on the operating system. A module might be required by the application or by one of the modules used by the application. Figure 4.1 shows a simple example of this.

Figure 4.1. Simple dynamic application

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.

When the application is executed a dynamic linker/loader, referred to as the dynamic linker throughout this document, loads the application into memory. The dynamic linker must also load any modules required by the application and any other required modules.

Any module required by an application or a different module is called a dependency. The dynamic linker typically needs to know the dependencies for the application and every module so that it can load all the required modules[3]. The dynamic linker also needs to ensure that any function calls or data accesses between the application and modules functions correctly.

To do this the dynamic linker must know what functions and data are available in a particular module. The dynamic linker also needs to know where to handle calls and data accesses between the different modules.

This means that the applications and modules need extra information encoded into the files to allow the dynamic linker to function correctly. This is described in Chapter 7 Technical overview of dynamic linking.

[3] Programs can use system functions such as the UNIX commands dlopen and dlsym to load an arbitrary shared library at run-time. In this case dlopen is explicitly naming the dependency. The dlsym function names the function definition in the library.

Copyright © 2010 ARM. All rights reserved.ARM DAI 0242A