> It's much simpler than that: Do either
>
> nm vmlinux | grep sys_call_table
>
> or
>
> grep sys_call_table System.map
>
> extract the address, use the header file to get the syscall number and
> the offset.
You're right but only in case System.map or vmlinux are available. In
some distros you only have the bzImage/vmlinuz, and still want to load
some module, without replacing the kernel.
My proposed script would derive this info from exported symbols in the
running kernel, so its more portable. Another advantage it has is gaining
access to non-globals. As long as they're referred by some exported
struct, even indirectly, they can be re-exported as globals. (Not that
I'd do it or recommend it to anyone :)
>
> Of course this all breaks the GPL, but you can get any non-exported
> symbol address that way.
It violates the GPL only if you distribute the resulting module. As long
as you run the script locally, generate the module locally, and only use
it locally, I don't see how it violates anything. GPL is a license for
distributors, not users.
Yoav Weiss
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/