All of the kernel build system “Kbuild” updates were merged today for the nearly-over Linux 6.16 merge window that is expected to conclude tomorrow with the Linux 6.16-rc1 release. Notable with the Kbuild pull is the introduction of the EXPORT_SYMBOL_GPL_FOR_MODULES helper.
Added to the Linux kernel today is the new EXPORT_SYMBOL_GPL_FOR_MODULES() helper. This macro can be used to limit the exporting of kernel symbols to a given list of modules.
The example given in the patch introducing EXPORT_SYMBOL_GPL_FOR_MODULES is:
EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, “kvm”);
So now it’s easy to limiting GPL symbols for allowed use by only select kernel modules. The macro puts the exported symbols into a module namespace that cannot be imported by other modules. Multiple modules can be specified with this macro using a comma separated list. The macro also supports tail-globs for selecting multiple modules like “drm_*” as another avenue.
The Kbuild pull for LInux 6.16 in addition to introducing this new macro also improves ABI handling within gendwarfksyms and brings a variety of other smaller fixes and enhancements.