I didn't know about undefined weak symbols. I was thinking:
int nosupport_function(void)
{
return -ENOSYS;
}
extern int support_function(void)
__attribute__((alias("nosupport_function"), weak));
....
int init(void)
{
/* Or you could simply call it... */
if (support_function == nosupport_function)
...
Of course, you can use symbol_get and symbol_put, too, but they don't
work if !CONFIG_MODULES: I chose to implement that case as simply a
reference, so you'll get a link failure: see linux/module.h.
Rusty.
-- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - 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/