Re: Patch-2.1.106ac2-3

Matthias Hanisch (matze@camline.com)
Thu, 18 Jun 1998 15:24:52 +0200 (METDST)


On Thu, 18 Jun 1998, Sylvain Pion wrote:

> On Thu, Jun 18, 1998 at 08:23:08AM -0400, grant@torque.net wrote:
> > It's not always obvious what's right, though. A couple of my drivers
> > were completely broken for several months because someone stuck in
> > __initdata in places where it did not belong.
>
> Is there a tool (or would it be easy to write), that checks these problems
> automatically. It could verify if all __init symbols are not accessed from
> all non __init functions. Is it feasible at link time by looking at the
> symbol table, or something like that ?

Actually I started in start_kernel() and traversed recursively through the
called functions (btw: I only looked over functions that are called with
my kernel configuration so there is a lot of missing here).

I verified every __init attribute using find/grep combos over the whole
kernel tree (for example, a function that is only called inside an
initfunc could be moved into the __init section, too).

So maybe this could be semi-automated using a script.

Another possibility is to grep over objdump output but that doesn't catch
indirect calls.

BTW: The strings used in initfuncs are still in the ordinary data section
and not all could be moved to .init.data in an easy and clean way (inside
printk, for example).

I have a patch for this, too, using a nifty __initstr macro by Alexander
V. Lukyanov but this only works with egcs. I think Martin Mares wanted to
implement such a feature natively in egcs but I don't know what the
current status is.

Matze

-- 
Matthias Hanisch     gesch.:matze@camline.com     priv.:matze@pingu.franken.de
                            +49 8137 935-219            +49 8441 82387

"Modell 10 - Software from Experts for Experts"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu