This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [RFC] stdlib: Make atexit to not act as __cxa_atexit


* Adhemerval Zanella:

>   3. exit is the only way where atexit handlers are actually called.
>      Unloading a library through dlclose does not issue the atexit
>      anymore (this is the main semantic change).

Sorry, I don't think this is the right direction.  We got the current
atexit behavior from Solaris, and I think it is useful.

  <https://docs.oracle.com/cd/E88353_01/html/E37843/atexit-3c.html>

I think the bug is that our implementation of that behavior interferes
with the execution order when there is no dlclose at all.  There should
be a different way for fixing that.

Maybe we can turn __cxa_finalize into a NOP and have the dynamic loader
handle atexit handlers directly on dlclose (assuming that it's always
called before the other ELF destructors)?

Or otherwise use flags to mark things, but in such a way that the
handlers are processed in reverse atexit order, unless a dlclose
happens.

Thanks,
Florian


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