On Fri, 11 Aug 2017, Todd C. Miller wrote:
> On Fri, 11 Aug 2017 16:31:44 +0200, Mark Kettenis wrote:
>
> > I've chosen to implement __cxa_thread_atexit() directly instead of
> > __cxa_thread_atexit_impl(). I think that is cleaner. It means we
> > don't need to make changes to libc++ for this to start working. It
> > looks like modern libstdc++ version will detect __cxa_thread_atexit().
> >
> > This adds a member to the "TIB". This means that you'll need to
> > install the new headers and rebuild ld.so before rebuilding libpthread
> > and libc.
>
> Is there a reason you didn't use mmap() and mprotect() like we do
> for __cxa_atexit()?

Advertising

Good point. It's per thread so it doesn't need the locking that the
atexit() bits require.
(Actually, the atfork bits should be converted to that too. Free
project!)
Philip