You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugin-interface: use extern "C" for plugin init function
Currently, smartvmi loads plugins dynamically by loading their
shared object. From that shared object, the main entry function is
searched. The problem with that is that the current approach depends
on the hard-coded C++-mangled symbol name. This however depends on
the toolchain (compiler version etc.). Specifically, when compiled
on NixOS, the name didn't match the upstream source code version.
As this symbol name is only relevant when loading a shared object into
memory as part of the shared object's metadata analysis, this name
doesn't have to be unique across plugins. Therefore, to get rid of
the hardcoded symbol name, we use "extern C" to make things easier
and more portable.
The function was renamed from "init" to "vmicore_plugin_init" to have
a more expressive name.
The disadvantage is that the caller can no longer implicitly verify
the function signature used when the plugin was compiled.
However, with a few more assertions, we can mitigate this mostly.
0 commit comments