<div dir="ltr"><div dir="ltr"><div dir="ltr">Hello guys.<div><br></div><div>I have a question about hotpatching supporting code.</div><div>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.</div><div>I need to achieve something like this, but using clang/lld under Linux and Macos.</div><div>The thing is I didn't find any options in clang to do this, probably I'm missing something?</div><div>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?</div><div>Will be grateful for any help, thank you!</div></div></div></div>