Reputation: 439
Is it possible in a linux kernel module to get the pointer of a function exported by another kernel module (something like cat /proc/kallsyms
) but with api calls. Also if it would be possbile to load the intended module into memory if it doesn't exist.
Basically what i am trying to do is to introduce a soft dependency between 2 modules. so i can execute one with or without the other.
Upvotes: 1
Views: 2952
Reputation: 9857
You can use: kallsyms_lookup_name(const char *name) Just include linux/kallsyms.h
Upvotes: 0
Reputation: 4127
Yes, this is possible. Using following Linux Kernel APIs,
find_symbol
API, you can search for desired symbol exists or notfind_module
and request_module
. Here is sample code for these APIs hereUpvotes: 1