Open llvmbot opened 6 years ago
I haven't added support for /HOTPATCH in clang yet. I'm not sure how much work that would be. Microsoft generates 0x8B 0xFF (mov edi,edi) at the beginning of each function when /HOTPATCH is specified / implied (x64), so that one could patch that by 0xEB 0xF9 (jmp -7) in order for hot patching can occur on the fly (see https://www.codeproject.com/Articles/27339/API-hooking-for-hotpatchable-operating-systems).
There's also the fact that a 2 GB virtual space should be .bss/left unused around the code when specifying /FUNCTIONPADMIN, so that a hotpatching tool can insert modified code around +/- 2 GB, which in turn is required for 32-bit JMP. This has yet to be done in LLD. Currently, this can be worked around by using /dynamicbase (otherwise the EXE is loaded at 0x140000000 and other things, like heap and VirtualAllocs, are using the space around that address).
r354716 added /functionpadmin. Is this enough for this bug, or is /hotpatch still needed?
Extended Description
In order to use real-time code updating tools such as Recode (www.indefiant.com), one needs to add /FUNCTIONPADMIN to the linker flags, and/or /HOTPATCH, depending on whether /INCREMENTAL is specified or not. Such as specified here: https://www.indefiant.com/recode/help/build.html
Is there a remote chance that these flags could be added to LLD?