DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
ELF object files

Initialization and termination functions

After the dynamic linker has built the process image and performed the relocations, each shared object gets the opportunity to execute some initialization code. These initialization functions are called in no specified order, but all shared object initializations happen before the executable file gains control.

Similarly, shared objects may have termination functions, which are executed with the atexit(S) mechanism after the base process begins its termination sequence. See atexit(S) for more information. Once again, the order in which the dynamic linker calls termination functions is unspecified.

Shared objects designate their initialization and termination functions through the DT_INIT and DT_FINI entries in the dynamic structure. See ``Dynamic section'' for more information. Typically, the code for these functions resides in the .init and .fini sections. See ``Section header'' for more information.


NOTE: Although the atexit() 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.


Previous topic: Symbol hash table

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003