Skip to contentSkip to conversation

should __modver_version_attr be const

PATCH Mark Salter 1 participant 1 message Apr 25, 2011 Module support

lore
Share & tools
lore
#0 lore raw

Shouldn't __modver_version_attr be const? It is placed in section __modver and asm-generic/vmlinux.lds.h puts section __modver in with RO_DATA_SECTION. Without the const, section __modver has RW attribute.

include/linux/module.h +1 -1
index 5de4204..e62f808 100644
@@ -174,7 +174,7 @@ extern struct module __this_module;
 #define MODULE_VERSION(_version)					\
 	extern ssize_t __modver_version_show(struct module_attribute *,	\
 					     struct module *, char *);	\
-	static struct module_version_attribute __modver_version_attr	\
+	static const struct module_version_attribute __modver_version_attr \
 	__used								\
     __attribute__ ((__section__ ("__modver"),aligned(sizeof(void *)))) \
 	= {								\

--Mark