egcs and shared LIBS on AIX4.1.5
David Edelsohn
dje@watson.ibm.com
Wed Mar 31 23:46:00 GMT 1999
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
More information about the Gcc
mailing list