Re: bogous binfmt_misc patch in 2.2.0-pre1

MOLNAR Ingo (mingo@chiara.csoma.elte.hu)
Sat, 2 Jan 1999 14:30:07 +0100 (CET)


On Fri, 1 Jan 1999, Linus Torvalds wrote:

> One thing I _have_ considered using a "section" trick for is the "init"
> routines. Right now one of the uglier files is drivers/net/Space.c, which
> is just endless "#ifconfig"s - and it should be possible to reasonably
> easily create a section for "device driver probe" addresses, and thus
> spread out these things into the drivers that actually implement them.

what i ment particularly in this case is something like:

...[old]...

#ifdef MODULE
int init_module (void)
{
}

void cleanup_module (void)
{
}
#endif

...[new]...

int __module init_module (void)
{
}

void __module cleanup_module (void)
{
}

the .text.module section is just ignored by the link script when linking
the final kernel image. (in the no-modules case __module also adds
'static' to the declaration)

(this means we might have to wrap some more module functionality to make
things compile even in the no module case, but the benefit is that the
code is more or less symmetric wrt. modules, thus we will get 'compilation
testing' even if someone isnt using the driver as a module. No more
'[bug] this doesnt compile as a module' mails.)

-- mingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/