This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: at exit alternative for AIX


On Sun, Aug 5, 2012 at 6:56 AM, Perry Smith <pedzsan@gmail.com> wrote:
>
> Part of my confusion / concern is "why have two methods?"
> Does the spec say that dtors much be called at different times?

The use of _GLOBAL_FD in GCC is AIX-specific, and appears to be
required to get destructors in shared libraries to run correctly when
the entire program exits.  The use of atexit instead of __cxa_atexit
is not AIX specific, but is an attempt to make shared library
destructors work correctly on systems without __cxa_atexit, when there
is no chance to run them at dlclose time.  I don't know the history
here, but it's quite possible that the two ideas were implemented
separately, and that nobody has ever really tried to make dlclose run
destructors correctly on AIX.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]