Dynamic binding for kernel module

That is, can a driver try to import a symbol for another driver, and if the symbol does not exist, the driver can continue loading without import permission? And even if it is possible, is it even permitted for the rising driver? ie already have a driver in the lnux kernel?

+6
source share
1 answer

exported EXPORT_SYMBOL or EXPORT_SYMBOL_GPL (if the import module has a GPL-compatible license) in any kernel module can be used by other modules.

if the symbol does not exist, can the driver continue loading without import permission?

I am not sure about that. But you can check if the character is exported from the output of cat /proc/kallsyms . exported characters will have two entries. One with the symbol name and the other with the _ksymtab prefix.

For example, for printk.

ffffffff814fd1e2 T printk ffffffff81812550 r __ksymtab_printk

+4
source

Source: https://habr.com/ru/post/927083/


All Articles