Linker and Libraries Guide

Initialization and Termination Functions

After the runtime linker has built the process image and performed the relocations, each shared object and the executable file get the opportunity to execute some initialization functions. All shared object initializations happen before the executable file gains control.

Similarly, dynamic objects can have termination functions, which are executed with the atexit(3C) mechanism after the base process begins its termination sequence, or if the object is removed frorm the running process with dlclose(3DL). Refer to atexit(3C) for more information.

Dynamic objects designate their initialization and termination functions through the DT_INIT_ARRAY/DT_INIT and DT_FINI_ARRAY/DT_FINI entries in the dynamic structure, described in Table 7-43.

For more information on initialization and termination see "Initialization and Termination Sections" and "Initialization and Termination Routines".


Note -

Although the atexit(3C) termination processing normally will be done, it is not guaranteed to have executed upon process death. In particular, the process will not execute the termination processing if it calls _exit() or if the process dies because it received a signal that it neither caught nor ignored.