From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Edelsohn To: "Groove, Christian" Cc: egcs@egcs.cygnus.com Subject: Re: egcs and shared LIBS on AIX4.1.5 Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: <9903180249.AA04638@marc.watson.ibm.com> References: <81A51A42F329D211904E00A0C9D8E2A0272340@falke.norcom.de> X-SW-Source: 1999-03n/msg00603.html Message-ID: <19990331234600.kGDYXmwSIXotGQOzmil_jmzg0DFcMNs0tP8zACsW_CA@z> I think that you might receive more responses if you did not disparage the systems about which you are asking for help. All GCC-produced shared objects contain functions _GLOBAL_DI() and _GLOBAL_DD() which will run the static initializers and finalizers in that object, but you need to obtain the functions from that object as the name is the same in every object. After you dynamically load an object, you can invoke that function to run the constructors. G++ does not know about AIX constructor/destructor priority. Separate work on G++ constructor/destructor priority is occurring, but there currently are no plans for it to interact with AIX's mechanisms. Ignoring priorities, GCC could produce objects which automatically run static constructors and destructors using AIX's loadAndInit() C++ call. No one has made the effort to implement this functionality which only provided a public interface beginning with AIX 4.2. One needs to prevent GCC's built-in static constructor and destructor functionality when used with executables that start with main() from running the constructors and destructors twice. David