The inside story on shared libraries and dynamic loading

Traditionally, developers have built software as stand-alone applications written in a single language such as Fortran, C, or C++. However, many scientists are starting to build their applications as extensions to scripting language interpreters or component frameworks. This often involves shared libraries and dynamically loadable modules. However, the inner workings of shared libraries and dynamic loading are some of the least understood and most mysterious areas of software development. We tour the inner workings of linkers, shared libraries, and dynamically loadable extension modules. Rather than simply providing a tutorial on creating shared libraries on different platforms, we want to provide an overview of how shared libraries work and how to use them to build extensible systems. For illustration, we use a few examples in C/C++ using the gcc compiler on GNU-Linux-i386. However, the concepts generally apply to other programming languages and operating systems.