Important: The information in this document is obsolete and should not be used for new development.
Static Constructors and Destructors
In MPW, if the input shared library contains static constructors or destructors, the MakeFlat tool performs special processing to ensure these routines are called at the proper time.MakeFlat adds a block of data to the top of the A5 world and adds a new code section. The data block consists of two new transition vectors, offsets to the library's original initialization and termination routines, and the contents of the code segment
%_Static_Constructor_Destructor_Pointers
. The new code section,%_CPlus_Static_Init_Term
, contains the two routines that call the static constructors and destructors. These two routines are then marked as being the library's initialization and termination routines.
- Note
- Because MakeFlat takes care of static object construction and destruction, you do not need to call the MPW routines
__init_lib
and__term_lib
when creating your own initialization and termination routines for shared libraries. However, when creating routines for CFM-68K runtime applications, you must call the corresponding__init_app
and__term_app
routines.