Files
Jacek Caban e134dc0294 [LLD][COFF] Emit ARM64X relocations for TLS directory (#213529)
The current behavior of merging EC and native chunks to have a single
TLS directory for both views matches the MSVC linker, but it has its
shortcomings. In addition to merging, that solution requires all TLS
callbacks to use -arm64xsameaddress, leaving it to the CRT to handle. If
the appropriate EC object files are not pulled in by linked EC code and
thus never have a chance to mark the callback with -arm64xsameaddress,
this may lead to an invalid image that crashes at runtime.

This patch avoids the entire problem by using entirely separate TLS
directories for EC and native views along with the standard ARM64X
dynamic relocation mechanism. Since callback lists are now separate, a
missing -arm64xsameaddress is no longer a problem.

Also, mingw-w64-crt currently doesn't mark its TLS callbacks with
-arm64xsameaddress. That could be changed if needed, but with this
change, it is no longer necessary.

(cherry picked from commit 65e92e073539c3fe3523256c4fba35ac1dedcb92)
2026-08-07 08:24:41 +00:00
..
…
…
…
…
…
…
…
…
…
…
…
…