home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / aix / 9082 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  1.4 KB

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