lkml.org 
[lkml]   [2003]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [MODULES] fix weak symbol handling
Date
In message <20030114171250.C5751@twiddle.net> you write:
> On Tue, Jan 14, 2003 at 07:39:44PM +1100, Rusty Russell wrote:
> > After that's reverted, here's my implementation. Richard?
>
> Nope. Doesn't handle undef weak. Handling of defined weak
> I'm not sure is necessary at all; I can't think of any good
> use for it in the kernel.

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/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.044 / U:26.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site