<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/85651>85651</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc] implement __cxa_finalize
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            nickdesaulniers
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nickdesaulniers
      </td>
    </tr>
</table>

<pre>
    This is a critical component for a C++ runtime, and tightly coupled to the implementation of `atexit`.

https://itanium-cxx-abi.github.io/cxx-abi/abi.html#dso-dtor-runtime-api

`__dso_handle` is a magical linker defined symbol.  `add_atexit_unit` will need to retain this, then `call_exit_callbacks` may need to skip certain callbacks based on their value of `__dso_handle`.

Due to how `exit_callbacks` is defined as using 1 of 3 possible containers, all three may need modifications.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkU8FuozAQ_RpzGQWBCSQ5cGgb5Qv2jgZ7CLMxNrJNm-zXr0xQu-1ewPLMe35v_Iwh8NUStaJ-FVJaVjdNARdjmXwQUor6nOESR-fbH8Wsd_rR_ho5AAdAUJ4jKzSg3DQ7SzbC4DwgvAn5KuQr-MVGnkjIN0CrIfJ1jOYByi2zIQ3RQRwJeJoNTWQjRnYW3ACiKTDSnaNoilwUZ1G8PL9jjHMQ1YuQFyEvHNHyMu3U_b7DnvMrx3Hpc3ZCXrY9IS-pMsbJCFnp4HY6Or_bhO1w5n_pRVN0nQ6uG9FqQ6IpnkYnvK4-DdsbedA0sCUN4TH1zuSw6tW6e2ruFrsKhw82Biw9jXqKyBbiyCGNI45kE0yhMd2KSqse1S0k6ISPT2S48QyK_Ir_7IIeA2lwiZLYwzuahbbZ_fDwbYLnhRLp6D5S5_8nc_i0hwGWwPYKZeKtYHYhcG8IlLNJzBqXN0BjII6e6Ev15DQPrNb7DHmm20qfqhNm1JaHsjgc6lqesrEdirKqpDwcahqafVOfTqT1UZenYj-gPFQZt7KQ-6Iqj2Uta3nKZXPoi7LUVaNRVce92Bc0IZvcmPcpd_6acQgLtce6qcvMYE8mbEE33Kst3b5N7bt-uQaxLwyHGL4IIkezPo4VUJ-_4gldp-7YDWzR8B_KFm_a74HcAqjcJOQlMW6_3ezdb1IxZTbpC0JeVol_AwAA___3Xi1E">