Re:On self-modifying executables in Rust
by stefan_ on Friday January 28, 2022 @07:55PM
(#30122612)
Function tracing in Linux works like this - only functions that you want to trace are modified at runtime to redirect execution, to keep it otherwise (almost) zero cost. They also have "static keys" to allow for seldom used features in performance critical code to be toggled on and off (through runtime code modification) that are used all over:
https://elixir.bootlin.com/linux/latest/source/include/linux...