5.7. Dynamic LoadingDynamically loaded (DL) libraries are libraries that are loaded at times other than during the startup of a program. At runtime, the program allows applications to load new modules into its address space for new functionalities without having to link the required libraries. They are particularly useful for implementing plug-ins or modules. Both AIX and Linux support dynamic loading. Table 5-5 compares the differences in how to dynamically load routines between AIX and Linux.
The basic dl functions (dlopen, dlclose, dladdr, and so on) for using DL libraries exhibit the same behavior in Linux as in AIX. The transition from AIX to Linux should be seamless. In Linux, to enable DL functionality, the application must link with the libld.so library, -ldl. Chapter 3 shows an example of how to use DL on Linux. |