Hi Amit..
On Fri, Dec 5, 2008 at 7:33 PM, amit mehta <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How does EXPORT_SYMBOL work ?
> All i know is that its a way by which a kernel module can export symbols to
> other kernel modules.
> Just to get more information on it, i looked for its definition(in
> linux/module.h) and found that
> its defined as:
> #define EXPORT_SYMBOL(sym) \
> __EXPORT_SYMBOL(sym, "")
>
> where,
> #define __EXPORT_SYMBOL(sym, sec) \
> extern typeof(sym) sym; \
> __CRC_SYMBOL(sym, sec) \
> static const char __kstrtab_##sym[] \
> __attribute__((section("__ksymtab_strings"))) \
> = MODULE_SYMBOL_PREFIX #sym; \
> static const struct kernel_symbol __ksymtab_##sym \
> __attribute_used__ \
> __attribute__((section("__ksymtab" sec), unused)) \
> = { (unsigned long)&sym, __kstrtab_##sym }
see that __attribute__ thingy? in short,it puts the related variable
into the mentioned ELF section,in this __ksymtab.
regards,
Mulyadi.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ