Re: [PATCH] Generic dead function optimisation

From: Graham Stoney (
Date: Wed Apr 26 2000 - 03:22:03 EST

Keith Owens wrote:
> Not to mention this case:
> static int do_something(void) {...}
> EXPORT_SYMBOL(do_something);
> Perfectly legal because of the way that the kernel handles exported
> symbols.

Sure, but do_something isn't unused in this case anyway, because EXPORT_SYMBOL
creates a reference to it.

Jeff Garzik writes:
> I would prefer that such a case be perfect illegal..

I think it would be much nicer to have a mechanism for specifying that a symbol
should be exported in its definition, rather than using the EXPORT_SYMBOL hack.
Something along the lines of:

    int __export do_something(void) {...}

I haven't worked out if __attribute__ has the magic required to pull this off,
but I'm open to suggestions.


Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

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

This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:10 EST