diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Documentation/dontdiff | 1 | ||||
| -rw-r--r-- | Documentation/kbuild/kbuild.txt | 5 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | include/asm-generic/vmlinux.lds.h | 1 | ||||
| -rw-r--r-- | include/linux/module.h | 1 | ||||
| -rw-r--r-- | include/linux/moduleparam.h | 12 | ||||
| -rwxr-xr-x | scripts/link-vmlinux.sh | 3 |
8 files changed, 19 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore index e7bb6c6edbae..2fb1765c33b0 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -58,6 +58,7 @@ modules.builtin | |||
| 58 | /vmlinuz | 58 | /vmlinuz |
| 59 | /System.map | 59 | /System.map |
| 60 | /Module.markers | 60 | /Module.markers |
| 61 | /modules.builtin.modinfo | ||
| 61 | 62 | ||
| 62 | # | 63 | # |
| 63 | # RPM spec file (make rpm-pkg) | 64 | # RPM spec file (make rpm-pkg) |
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index ef25a066d952..512fa0239ebf 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
| @@ -178,6 +178,7 @@ mktables | |||
| 178 | mktree | 178 | mktree |
| 179 | modpost | 179 | modpost |
| 180 | modules.builtin | 180 | modules.builtin |
| 181 | modules.builtin.modinfo | ||
| 181 | modules.order | 182 | modules.order |
| 182 | modversions.h* | 183 | modversions.h* |
| 183 | nconf | 184 | nconf |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index 8a3830b39c7d..9c230ea71963 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
| @@ -11,6 +11,11 @@ modules.builtin | |||
| 11 | This file lists all modules that are built into the kernel. This is used | 11 | This file lists all modules that are built into the kernel. This is used |
| 12 | by modprobe to not fail when trying to load something builtin. | 12 | by modprobe to not fail when trying to load something builtin. |
| 13 | 13 | ||
| 14 | modules.builtin.modinfo | ||
| 15 | -------------------------------------------------- | ||
| 16 | This file contains modinfo from all modules that are built into the kernel. | ||
| 17 | Unlike modinfo of a separate module, all fields are prefixed with module name. | ||
| 18 | |||
| 14 | 19 | ||
| 15 | Environment variables | 20 | Environment variables |
| 16 | 21 | ||
| @@ -1308,6 +1308,7 @@ _modinst_: | |||
| 1308 | fi | 1308 | fi |
| 1309 | @cp -f $(objtree)/modules.order $(MODLIB)/ | 1309 | @cp -f $(objtree)/modules.order $(MODLIB)/ |
| 1310 | @cp -f $(objtree)/modules.builtin $(MODLIB)/ | 1310 | @cp -f $(objtree)/modules.builtin $(MODLIB)/ |
| 1311 | @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ | ||
| 1311 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst | 1312 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
| 1312 | 1313 | ||
| 1313 | # This depmod is only for convenience to give the initial | 1314 | # This depmod is only for convenience to give the initial |
| @@ -1348,6 +1349,7 @@ endif # CONFIG_MODULES | |||
| 1348 | 1349 | ||
| 1349 | # Directories & files removed with 'make clean' | 1350 | # Directories & files removed with 'make clean' |
| 1350 | CLEAN_DIRS += $(MODVERDIR) include/ksym | 1351 | CLEAN_DIRS += $(MODVERDIR) include/ksym |
| 1352 | CLEAN_FILES += modules.builtin.modinfo | ||
| 1351 | 1353 | ||
| 1352 | # Directories & files removed with 'make mrproper' | 1354 | # Directories & files removed with 'make mrproper' |
| 1353 | MRPROPER_DIRS += include/config usr/include include/generated \ | 1355 | MRPROPER_DIRS += include/config usr/include include/generated \ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f8f6f04c4453..bbb9e332f2fe 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -844,6 +844,7 @@ | |||
| 844 | EXIT_CALL \ | 844 | EXIT_CALL \ |
| 845 | *(.discard) \ | 845 | *(.discard) \ |
| 846 | *(.discard.*) \ | 846 | *(.discard.*) \ |
| 847 | *(.modinfo) \ | ||
| 847 | } | 848 | } |
| 848 | 849 | ||
| 849 | /** | 850 | /** |
diff --git a/include/linux/module.h b/include/linux/module.h index 5bf5dcd91009..5f7007430d35 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -253,6 +253,7 @@ extern typeof(name) __mod_##type##__##name##_device_table \ | |||
| 253 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 253 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
| 254 | #else | 254 | #else |
| 255 | #define MODULE_VERSION(_version) \ | 255 | #define MODULE_VERSION(_version) \ |
| 256 | MODULE_INFO(version, _version); \ | ||
| 256 | static struct module_version_attribute ___modver_attr = { \ | 257 | static struct module_version_attribute ___modver_attr = { \ |
| 257 | .mattr = { \ | 258 | .mattr = { \ |
| 258 | .attr = { \ | 259 | .attr = { \ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index ba36506db4fb..5ba250d9172a 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -10,23 +10,21 @@ | |||
| 10 | module name. */ | 10 | module name. */ |
| 11 | #ifdef MODULE | 11 | #ifdef MODULE |
| 12 | #define MODULE_PARAM_PREFIX /* empty */ | 12 | #define MODULE_PARAM_PREFIX /* empty */ |
| 13 | #define __MODULE_INFO_PREFIX /* empty */ | ||
| 13 | #else | 14 | #else |
| 14 | #define MODULE_PARAM_PREFIX KBUILD_MODNAME "." | 15 | #define MODULE_PARAM_PREFIX KBUILD_MODNAME "." |
| 16 | /* We cannot use MODULE_PARAM_PREFIX because some modules override it. */ | ||
| 17 | #define __MODULE_INFO_PREFIX KBUILD_MODNAME "." | ||
| 15 | #endif | 18 | #endif |
| 16 | 19 | ||
| 17 | /* Chosen so that structs with an unsigned long line up. */ | 20 | /* Chosen so that structs with an unsigned long line up. */ |
| 18 | #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) | 21 | #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) |
| 19 | 22 | ||
| 20 | #ifdef MODULE | ||
| 21 | #define __MODULE_INFO(tag, name, info) \ | 23 | #define __MODULE_INFO(tag, name, info) \ |
| 22 | static const char __UNIQUE_ID(name)[] \ | 24 | static const char __UNIQUE_ID(name)[] \ |
| 23 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ | 25 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ |
| 24 | = __stringify(tag) "=" info | 26 | = __MODULE_INFO_PREFIX __stringify(tag) "=" info |
| 25 | #else /* !MODULE */ | 27 | |
| 26 | /* This struct is here for syntactic coherency, it is not used */ | ||
| 27 | #define __MODULE_INFO(tag, name, info) \ | ||
| 28 | struct __UNIQUE_ID(name) {} | ||
| 29 | #endif | ||
| 30 | #define __MODULE_PARM_TYPE(name, _type) \ | 28 | #define __MODULE_PARM_TYPE(name, _type) \ |
| 31 | __MODULE_INFO(parmtype, name##type, #name ":" _type) | 29 | __MODULE_INFO(parmtype, name##type, #name ":" _type) |
| 32 | 30 | ||
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index dc0e8c5a1402..e4383e0f476e 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
| @@ -193,6 +193,9 @@ modpost_link vmlinux.o | |||
| 193 | # modpost vmlinux.o to check for section mismatches | 193 | # modpost vmlinux.o to check for section mismatches |
| 194 | ${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o | 194 | ${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o |
| 195 | 195 | ||
| 196 | info MODINFO modules.builtin.modinfo | ||
| 197 | ${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo | ||
| 198 | |||
| 196 | kallsymso="" | 199 | kallsymso="" |
| 197 | kallsyms_vmlinux="" | 200 | kallsyms_vmlinux="" |
| 198 | if [ -n "${CONFIG_KALLSYMS}" ]; then | 201 | if [ -n "${CONFIG_KALLSYMS}" ]; then |
