home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!utcsri!turing.toronto.edu!mendell
- Newsgroups: comp.unix.aix
- From: mendell@turing.toronto.edu (Mark Mendell)
- Subject: Re: C++ {con,de}structor linkage
- Message-ID: <1992Aug25.222652.11772@jarvis.csri.toronto.edu>
- Organization: IBM Toronto Lab
- References: <1992Aug25.063933.956@mintaka.lcs.mit.edu>
- Date: 26 Aug 92 02:26:52 GMT
- Lines: 20
-
- xlC supports static constructors/destructors in a manner similar to the
- 'munch' version of Cfront. The code is bundled up into procedures with
- known names (__sinitXXX and __stermXXX). There is a program 'munch' that
- processes all the .o and .a files before the link, looking for those names.
- munch creates a data structure that is linked into the executable. At startup,
- the runtime startup uses that structure to invoke all the constructors.
-
- In addition, the runtime startup code looks at all shared libraries, and
- invokes the static constructors in each library. See the 'makeC++SharedLibrary'
- section of the manual to see how to create such a library. There is a method
- to specify the 'priority' of libraries, to ensure that libraries are initialized
- in the corrct order.
-
- Currently, there is no support for running constructors/destructors from shared
- libraries that are loaded at run time (as compared to libraries from the ld
- step).
- --
- Mark Mendell
- IBM Toronto Lab
- mendell@torolab6.vnet.ibm.com
-