summaryrefslogtreecommitdiff
path: root/Documentation/kbuild
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2019-09-06 11:32:28 +0100
committerJessica Yu <jeyu@kernel.org>2019-09-10 10:30:21 +0200
commitcb9b55d21fe06ca5e4ba244bb5aac0afeb745c8e (patch)
tree43ee0d936c54f40075397eaad10e26298115d988 /Documentation/kbuild
parent8651ec01daedad26290f76beeb4736f9d2da4b87 (diff)
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>
Diffstat (limited to 'Documentation/kbuild')
-rw-r--r--Documentation/kbuild/modules.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/modules.rst
index 24e763482650..d2ae799237fd 100644
--- a/Documentation/kbuild/modules.rst
+++ b/Documentation/kbuild/modules.rst
@@ -470,9 +470,12 @@ build.
The syntax of the Module.symvers file is::
- <CRC> <Symbol> <module>
+ <CRC> <Symbol> <Namespace> <Module> <Export Type>
- 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod
+ 0xe1cc2a05 usb_stor_suspend USB_STORAGE drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL
+
+ The fields are separated by tabs and values may be empty (e.g.
+ if no namespace is defined for an exported symbol).
For a kernel build without CONFIG_MODVERSIONS enabled, the CRC
would read 0x00000000.