I am working on a project which consists of multiple kernel modules. There is some shared functionality between the different modules, but I don’t want to include the same code in each module. Does the Linux kernel have a “shared object library” or does the common code go into a separate module?
Share
Typically, you would put the functionality common to the modules in a separate module itself. A good example of this is the
drivers/scsi/libsasmodule used by other SAS (Serial Attached SCSI) device drivers. If you go this route, see the kernel documentation in section 6.3 ofDocumentation/kbuild/modules.txtfor suggestions on referencing symbols from other external modules.