Re: Patch-2.1.106ac2-3

Dean Gaudet (dgaudet-list-linux-kernel@arctic.org)
Thu, 18 Jun 1998 11:21:50 -0700 (PDT)


With suitable modifications to gcc it's possible to check this stuff
completely at compile time.

Add an __attribute__((initstuff)). Functions with that attribute can call
any function, and use any identifier without warning. Functions without
that attribute cause warnings when they call initstuff functions or use
initstuff data.

pointers to function: These carry the attribute as well. So void (*)()
is different from void (*)() __attribute__((initstuff)). You can use a
non-initstuff pointer where an initstuff pointer is expected. The other
way around causes a warning.

Similarly for data.

Dean

On Thu, 18 Jun 1998, Matthias Hanisch wrote:

> 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
>

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