Re: Linux GPL and binary module exception clause?
From: Nix
Date: Fri Dec 12 2003 - 19:13:56 EST
[catching up with vast backlog]
On Thu, 4 Dec 2003, viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mused:
> FWIW, it would be very nice if somebody did hard and messy work and
> produced lists of in-tree modules using given symbols. Ideally - automated
> that, but that won't be easy to do (quite a few are used only via inlined
> wrappers and in some cases - under an ifdef; many arch-specific exports
> are of that sort).
ISTM that this could be done quite easily with a hacked-up libcpp that
does token pasting and #include processing, but does *not* process #if
statements themselves.
Preprocess every translation unit in the kernel with that, and grep each
of them for every exported symbol in turn, and bingo. :)
I'll have a hack sometime this weekend if nobody else gets around to it.
(Of course, this will say that stuff in #if 0's and other #ifdef
branches that can't be reached is in fact used, but such code isn't
common.)
> Some approximation might be obtained by building all modules and
> doing nm on them, with manual work for non-obvious cases.
Hang on, surely you can tell which symbols in modules are exported just
by looking for expansions of EXPORT_SYMBOL{_GPL}? Why is this bit hard?
I think the problem is you're trying to compile rather than doing a
hacked -E :) we don't need to compile for this, just do most of the
preprocessing phase.
--
`...some suburbanite DSL customer who thinks kernel patches are some
form of military insignia.' --- Bob Apthorpe
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/