I have a proprietary Linux module which might be loaded before or after a second proprietary module that contain the function foo.
I would like my first module, when being configured dynamically, to lookup for the second's module symbol foo, and if found to call it.
The general idea (in loose syntax) is this:
/* check if the module/symbol can be found */
module, foo_cb = lookup_for_a_symbol("foo");
if (foo_cb && module) {
/* increment the refcnt to make sure the module will not be unloaded */
module_try_get(module);
foo_cb(my_params);
/* release the module */
module_put(module);
}
I found a function in module.c that does something like this called find_symbol, however it is GPL.
Any non-GPL alternative for dynamic symbol lookup ?
Thanks.