On 05/28/2015 01:39 AM, Maxim Kuvyrkov wrote: > Hi, > > Akashi-san and I have been discussing required GCC changes to make kernel's > livepatching work for AArch64 and other architectures. At the moment > livepatching is supported for x86[_64] using the following options: "-pg > -mfentry -mrecord-mcount -mnop-mcount" which is geek-speak for "please add > several NOPs at the very beginning of each function, and make a section with > addresses of all those NOP pads".
FYI, there is also the darwin/rs6000 -mfix-and-continue support, which adds 5 nops to the prologue. This was a part of a gdb feature, to allow one to load a fixed function into a binary inside the debugger, and then continue executing with the fixed code. It sounds like your kernel feature is doing something very similar. If you are making this a generic feature, then maybe the darwin/rs6000 -mfix-and-continue support can be merged with it somehow. Jim