From: Ron Gage <ron@rongage.org>
To: linux-kernel@vger.kernel.org
Subject: Question about module.[c,h] - kernel 2.4.18
Date: 11 May 2002 20:33:09 -0400 [thread overview]
Message-ID: <1021163601.558.32.camel@portable> (raw)
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
is...
The code in question from module.c...
struct module kernel_module =
{
size_of_struct: sizeof(struct module),
name: "",
uc: {ATOMIC_INIT(1)},
flags: MOD_RUNNING,
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;
union
{
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;
#endif
/* 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
(ron@rongage.org)
next reply other threads:[~2002-05-12 0:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-12 0:33 Ron Gage [this message]
2002-05-12 1:06 ` Keith Owens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1021163601.558.32.camel@portable \
--to=ron@rongage.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®