help needed with EXPORT_SYMBOL

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Aijaz Baig
Date: Friday, August 20, 2010 - 11:57 pm

Hello,

Ive been trying to EXPORT a SYMBOL from a netfilter module (actually a
hook) to the KERNEL. Various modules seem to export various symbols to
the kernel (or so it seems), an example being x_tables which exports a
whole lot of functions like xt_register_target and so on and all other
netfilter modules which use these functions dont seem to have any
problems.

So why is it that when my netfilter module is exporting something to the
kernel and im tryin to use it from within a core kernel file, the
compiler flags a 'undefined reference to' error?

I googled and came to the conclusion from the kernelnewbies mailing list
that using kallsyms_lookup() seems to be the answer or is it?
So, if I do intend to use kallsyms_lookup how do I use it? There aren't
so many instances of it being used it seems.
 
Ive seen it being used in dev/core.c like so:
symname = kallsyms_lookup((unsigned long)sym, &symsize,&offset,&modname,
namebuf);

I am basically trying to call a function that MY module EXPORTs inside
one of the core linux routines. This would also mean that my netfilter
module must be compiled (and linked also maybe?..not so sound with link
time stuff) before the address becomes visible so that kallsyms_lookup
can find it. So do I really shd be using it and if so, how?

Any input is appreciated.

Regards,
Aijaz Baig.



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
help needed with EXPORT_SYMBOL, Aijaz Baig, (Fri Aug 20, 11:57 pm)
Re: help needed with EXPORT_SYMBOL, Jan Engelhardt, (Sat Aug 21, 2:23 am)
Re: help needed with EXPORT_SYMBOL, Aijaz Baig, (Sun Aug 22, 10:14 pm)
Re: help needed with EXPORT_SYMBOL, Brian Gerst, (Mon Aug 23, 4:48 am)
Re: help needed with EXPORT_SYMBOL, Peter Zijlstra, (Mon Aug 23, 6:17 am)
Re: help needed with EXPORT_SYMBOL, Jan Engelhardt, (Mon Aug 23, 6:32 am)
Re: help needed with EXPORT_SYMBOL, Peter Zijlstra, (Mon Aug 23, 6:43 am)
Re: help needed with EXPORT_SYMBOL, Brian Gerst, (Mon Aug 23, 6:44 am)
Re: help needed with EXPORT_SYMBOL, Peter Zijlstra, (Mon Aug 23, 7:05 am)
Re: help needed with EXPORT_SYMBOL, Aijaz Baig, (Mon Aug 23, 9:44 pm)
Re: Fwd: help needed with EXPORT_SYMBOL, Aijaz Baig, (Wed Aug 25, 2:27 am)
Re: Fwd: help needed with EXPORT_SYMBOL, Jan Engelhardt, (Wed Aug 25, 3:06 am)
Re: Fwd: help needed with EXPORT_SYMBOL, Peter Zijlstra, (Wed Aug 25, 3:23 am)
Re: Fwd: help needed with EXPORT_SYMBOL, Randy Dunlap, (Wed Aug 25, 8:37 am)