[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 9 12:25:51 PDT 2025
sivadeilra wrote:
Ok, I've redone the code that modifies GlobalVariable references. It is more complicated, but that was necessary to handle constant expressions. There are detailed comments in the code, so I'll let those comments speak for themselves.
Fixed a bug in how the `__ref_*` variables were created. They were being created as constants, but that's incorrect; it allows the optimizer to read the initializer / definition and then inline it into places that use the GV. That defeats the whole purpose of the redirection mechanism. I've changed the variables so that they are non-constant.
Fixed a bug where the `__ref_*` variables were marked for internal linkage. They need to be external-but-weak.
https://github.com/llvm/llvm-project/pull/138972
More information about the cfe-commits
mailing list