3 ms·
> Are there any languages that could actually make use of self modifying code? Kernel livepatching (and by that ftrace) would come to mind.
by pantalaimon 8y ago
> Are there any languages that could actually make use of self modifying code?
Kernel livepatching (and by that ftrace) would come to mind.
- benj111 8y agoWould they not just write a new patched page, and swap out the original? Seems less error prone?
- pantalaimon 8y agoAs I understand it they make the compiler add a few noops in the beginning of each non-static function. Then to add tracing or change the behavior of the function, the noops are overwritten by a jump to the new code.
- nickpsecurity 8y agoIt's almost always a better idea to create something new, verify it was created successfully, do any syncing, switchover, optionally re-check for correct syncing, and then delete or take down original. That's pretty much how robust clustering works.