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?