Linking and Binding

A shared library can be linked into one or more system executables. When the system executables are executed the system loader loads one copy of the shared library, shares the code area and creates separate data areas for each executable. The shared library remains loaded until the system executable process terminates. A shared library file has a prefix of lib and filename extension of .so.

Callable shared objects are different from shared libraries, but have the same filename extension .so. Callable shared objects are a callable file format, which means that they are dynamically loaded and unloaded at run-time, if and when required. Shared libraries can be linked into callable shared objects.

Binding of a program or subprogram is carried out by the system loader at run time. If the executable file contains a reference to an external procedure (subprogram or even a main program) in a shared library file, the system loader ensures that the procedure is made available for execution. The system loader ensures that, however many concurrent users or applications are bound to that procedure, they all share a single copy in memory of the dynamically-bound procedure.

Linking of a procedure is carried out by the system linker at link time. The linker does not include the code for a linked procedure in the system executable file, but does include a reference to the shared library file that contains the procedure's object code.