Is there a way to specify a function that is executed as soon as my library – written in Rust – gets loaded? Basically, I am looking for something like GCC’s
DllMain on Windows, though I would be content with a Linux-specific solution).
I need something like this because I am trying to implement a method of function hooking that is based on library injection. The injected library has to hook the functions as soon as it gets loaded. Is this possible with (nightly) Rust?