https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113401
--- Comment #2 from Florian Weimer <fw at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #1) > (In reply to Florian Weimer from comment #0) > > > The fix is to register a TLS destructor to > > deallocate that page, too. On glibc, that also fixes another memory leak for > > -fno-exceptions compilations (the default for C) if pthread_exit is called > > with an active trampoline. > > Does this mean you have a proposed patch already? (before I start > investigation) No, this was a reference to __cxa_thread_atexit, which is unfortunately in libstdc++ (but is a thin shim around __cxa_thread_atexit_impl for current glibc). The pthread_key_create fallback probably needs to be duplicated into libgcc_s.