[lkml]   [2002]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectQuestion about module.[c,h] - kernel 2.4.18
Hi folks:

I am in the process of doing some compile cleanups - a la kernel
janitors project type stuff.

I came across a fairly major inconsistancy in module.c and module.h and
I was hoping someone could tell me just how whacked my view of this

The code in question from module.c...

struct module kernel_module =
size_of_struct: sizeof(struct module),
name: "",
uc: {ATOMIC_INIT(1)},
syms: __start___ksymtab,
ex_table_start: __start___ex_table,
ex_table_end: __stop___ex_table,
kallsyms_start: __start___kallsyms,
kallsyms_end: __stop___kallsyms,


Looks fairly straight forward, but it is missing several elements from
the module struct. The module struct is defined as follows:

struct module
unsigned long size_of_struct; /* == sizeof(module) */
struct module *next;
const char *name;
unsigned long size;

atomic_t usecount;
long pad;
} uc; /* Needs to keep its size - so
says rth */

unsigned long flags; /* AUTOCLEAN et al */

unsigned nsyms;
unsigned ndeps;

struct module_symbol *syms;
struct module_ref *deps;
struct module_ref *refs;
int (*init)(void);
void (*cleanup)(void);
const struct exception_table_entry *ex_table_start;
const struct exception_table_entry *ex_table_end;
#ifdef __alpha__
unsigned long gp;
/* Members past this point are extensions to the basic
module support and are optional. Use mod_member_present()
to examine them. */
const struct module_persist *persist_start;
const struct module_persist *persist_end;
int (*can_unload)(void);
int runsize; /* In modutils, not currently
used */
const char *kallsyms_start; /* All symbols for kernel
debugging */
const char *kallsyms_end;
const char *archdata_start; /* arch specific data for module
const char *archdata_end;
const char *kernel_data; /* Reserved for kernel internal
use */

In essence, there are 20 elements to the module struct (i386), but
module.c only initializes 9 of those elements. This gives 11
uninitialized elements (and compile warnings). These warnings are what
I am trying to kill off.

Does anyone see any problems with initializing the remaining elements of
this struct?

Ron Gage - Saginaw, MI

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:22    [W:0.051 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site