Re: Query on EXPORT_SYMBOL and friends macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Amit..

On Fri, Dec 5, 2008 at 7:33 PM, amit mehta <amit4g@xxxxxxxxx> 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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux