libc: Attempt to execute new atexit() destructors during __cxa_finalize().
authorzrj <rimvydas.jasinskas@gmail.com>
Thu, 25 Feb 2021 03:15:49 +0000 (03:15 +0000)
committerzrj <rimvydas.jasinskas@gmail.com>
Thu, 25 Feb 2021 03:32:45 +0000 (05:32 +0200)
commit9736b3580bcebfd19085b7c7b48f52886bacba6b
tree609e8bcd75e35894ffffd72808540c6d39ad4c2a
parentc958b47c43f0866cc673e1e25ed98959b07b6000
libc: Attempt to execute new atexit() destructors during __cxa_finalize().

 Some c++ programs might and do register new destructors from other
 destructors.  Try to handle such cases by relooping scan upto
 CXA_DTORS_ITERATIONS times (like what _thread_finalize() does) if new
 destructors get added even if that will not strictly match LIFO order.
lib/libc/stdlib/atexit.c