https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112980
--- Comment #17 from Kewen Lin <linkw at gcc dot gnu.org> --- (In reply to Michael Matz from comment #16) > (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. > Thanks again for confirming this understanding! > I think your current proposal from comment #10 is the better from all > perspectives. Yeah, I agree. When reworking this support previously, comment #10 like implementation was considered as a better one but it's not finally made due to the concern that can break the assumption NOPs should be consecutive, based on all the inputs here I think it's time to "fix" it by just underscoring this special not-consecutive NOPs in documentation.