[clang] [llvm] Add support for Windows hot-patching (PR #138972)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 14:14:36 PDT 2025


aganea wrote:

Thanks for the answer.

Are these new flags `-fms-hotpatch-functions-file=` and `-fms-hotpatch-functions-list=` populated with data maintained manually by the Windows developpers?

If I understand correctly, what you describe as "symbols that were hot-patched" means functions that are ready/candidates for hotpatching at runtime on the OS that installs the hotpatch, is that right?

I get the part about the security and verification, but I still don't get the `_ref_` thing. Usually after injecting the patched DLLs/SYS files into a process, the patcher can (automatically, from the relocs) redirect pointers present in the injected DLL to actually use the global state that is being used by the in-memory DLL. Is this `_ref_` related to a synchronization thing? Or timing? I would assume the kernel still needs a sync point where it stops ticking the process, installs the patch, patches all the function pointers from the in-memory DLL to the new injected DLL?

It'd be really nice if someone at Microsoft could write at some point a supporting documentation to understand how all this is to be used (a tech blog or a white paper describing it?)

https://github.com/llvm/llvm-project/pull/138972


More information about the llvm-commits mailing list