[cfe-dev] Question about hotpatching

Dovod Dovodov via cfe-dev cfe-dev at lists.llvm.org
Wed Dec 19 01:48:50 PST 2018


Hello guys.

I have a question about hotpatching supporting code.
MSVC compiler can compile code able to be patched "on the fly" by inserting
dummy function preamble and reserving some space before function body to
allow to redirect execution flow to another place using unconditional jump.
This behaviour is controlled by /hotpatch and /functionpadmin compiler and
linker options.
I need to achieve something like this, but using clang/lld under Linux and
Macos.
The thing is I didn't find any options in clang to do this, probably I'm
missing something?
The only idea I came up with is to compile my code with
-finstrument-function-entry-bare to reserve some space in the beginning of
each function for later code injection, but it leads to too much overhead.
Probably you're aware of better approach?
Will be grateful for any help, thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181219/e22eacc2/attachment.html>


More information about the cfe-dev mailing list