From <linux/module.h>
:
#ifdef MODULE
#define MODULE_GENERIC_TABLE(gtype,name) \
extern const struct gtype##_id __mod_##gtype##_table \
__attribute__ ((unused, alias(__stringify(name))))
extern struct module __this_module;
#define THIS_MODULE (&__this_module)
#else /* !MODULE */
#define MODULE_GENERIC_TABLE(gtype,name)
#define THIS_MODULE ((struct module *)0)
#endif
I can see "extern struct module __this_module;
" is just a declaration of __this_module
, but not definition of __this_module
. So where is the memory allocation of __this_module
? I can't find it in kernel
code.