modpost: add support for symbol namespaces
authorMatthias Maennich <maennich@google.com>
Fri, 6 Sep 2019 10:32:28 +0000 (11:32 +0100)
committerJessica Yu <jeyu@kernel.org>
Tue, 10 Sep 2019 08:30:21 +0000 (10:30 +0200)
commitcb9b55d21fe06ca5e4ba244bb5aac0afeb745c8e
tree43ee0d936c54f40075397eaad10e26298115d988
parent8651ec01daedad26290f76beeb4736f9d2da4b87
modpost: add support for symbol namespaces

Add support for symbols that are exported into namespaces. For that,
extract any namespace suffix from the symbol name. In addition, emit a
warning whenever a module refers to an exported symbol without
explicitly importing the namespace that it is defined in. This patch
consistently adds the namespace suffix to symbol names exported into
Module.symvers.

Example warning emitted by modpost in case of the above violation:

 WARNING: module ums-usbat uses symbol usb_stor_resume from namespace
 USB_STORAGE, but does not import it.

Co-developed-by: Martijn Coenen <maco@android.com>
Signed-off-by: Martijn Coenen <maco@android.com>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Documentation/kbuild/modules.rst
scripts/export_report.pl
scripts/mod/modpost.c
scripts/mod/modpost.h