Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse authored Apr 16, 2022
1 parent 3250d02 commit 94bd7c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Normally, mingw-w64 CRT performs per-thread cleanup upon receipt of `DLL_PROCESS
2. These callbacks are still invoked if the user calls `_Exit()` or `quick_exit()`, such as [in LLVM](https://reviews.llvm.org/D102944). As specified by the C++ standard, they shall not be called.
3. Per-thread cleanup may be performed after destructors of static objects. The C++ standard does not allow this behavior.

GCC uses `atexit()` to register destructors for static objects. Therefore, the CRT has to be modified to forward such calls to `__MCF_cxa_atexit()`, passing the address of the module-specific `__dso_handle` as its third argument to it. The modified CRT also forwards calls to `exit()`, `_Exit()`, `_exit()` and `quick_exit()` to standard-conforming ones in mcfgthread, which eventually calls `TerminateProcess()` instead of `ExitProcess()`, to address such issues. Per-thread and process cleanup is performed by `__cxa_finalize(NULL)`,in accordance with the Itanium ABI.
GCC uses `atexit()` to register destructors for static objects. Therefore, the CRT has to be modified to forward such calls to `__MCF_cxa_atexit()`, passing the address of the module-specific `__dso_handle` as their third arguments. The modified CRT also forwards calls to `exit()`, `_Exit()`, `_exit()` and `quick_exit()` to standard-conforming ones in mcfgthread, which eventually calls `TerminateProcess()` instead of `ExitProcess()`, to address such issues. Per-thread and process cleanup is performed by `__cxa_finalize()`,in accordance with the Itanium ABI.

0 comments on commit 94bd7c5

Please sign in to comment.