https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112980
--- Comment #16 from Michael Matz <matz at gcc dot gnu.org> --- (In reply to Kewen Lin from comment #15) > I agree, thanks for the comments! btw, I'm not fighting for the current > implementation, just want to know more details why users are unable to make > use of the current implementation, is it just due to its inefficiency (like > the above sequence) or un-usability (unused at all). As your comments, I > think it's due to the former (inefficiency)?! Okay. So, yeah, I _think_ that other way (with NOPs between GEP and LEP, plus a jump around them) could be made to work with userspace live patching. It would just be inefficient. But do note that that jump around was _not_ part of the original way of -fpatchable-function-entry, so a change to codegen would have to have happened anyway to make that other way usable. And it has the (perhaps theoretical, who knows :) ) problem of not using the normal 8-byte difference between GEP and LEP. I think your current proposal from comment #10 is the better from all perspectives.