diff --git a/Makefile b/Makefile index d0d2652db174..682652523a00 100644 --- a/Makefile +++ b/Makefile @@ -1302,6 +1302,7 @@ _modinst_: fi @cp -f $(objtree)/modules.order $(MODLIB)/ @cp -f $(objtree)/modules.builtin $(MODLIB)/ + @cp -f $(objtree)/kernel.builtin.modinfo $(MODLIB)/ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst # This depmod is only for convenience to give the initial diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index ba36506db4fb..1ef1d8bd06ca 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -17,16 +17,11 @@ /* Chosen so that structs with an unsigned long line up. */ #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) -#ifdef MODULE #define __MODULE_INFO(tag, name, info) \ static const char __UNIQUE_ID(name)[] \ __used __attribute__((section(".modinfo"), unused, aligned(1))) \ - = __stringify(tag) "=" info -#else /* !MODULE */ -/* This struct is here for syntactic coherency, it is not used */ -#define __MODULE_INFO(tag, name, info) \ - struct __UNIQUE_ID(name) {} -#endif + = MODULE_PARAM_PREFIX __stringify(tag) "=" info + #define __MODULE_PARM_TYPE(name, _type) \ __MODULE_INFO(parmtype, name##type, #name ":" _type) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 9045823c7be7..5162fc7046ca 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -303,3 +303,8 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then exit 1 fi fi + +info MODINFO kernel.builtin.modinfo +"${OBJCOPY}" -j .modinfo -O binary vmlinux kernel.builtin.modinfo +chmod 444 kernel.builtin.modinfo +"${OBJCOPY}" -R .modinfo vmlinux