mark at csn.ul.ie
Thu Mar 1 14:13:12 GMT 2001
On Wed, 28 Feb 2001, Joe Harrington wrote:
> Does anyone know how exactly EXPORT_SYMBOL(blah) works. For example in my
> simple module that I created I have a
> struct proc_dir_entry stuctName;
> declared, can I put a link to structName in two other modules as well by
> using EXPORT_SYMBOL.
Presuming you are talking about EXPORT_SYMBOL in the Linux
kernel :), you might be better off asking the question
on the kernelnewbies list, but I'll give a go..
EXPORT_SYMBOL is used to define symbols which may
be used from other modules. So unless you are writing
a stack of modules you won't need it.
What EXPORT_SYMBOL actually does is define the address
and name of all the symbols exported from the module or
kernel with EXPORT_SYMBOL in the __ksymtab section. Insmod
uses this info to load the module and relocate symbols. It
will refuse to load a module that tries to use any kernel
symbols not defined in then kernel's __ksymtab section.
You can see what symbols are exported by the kernel using
> objdump --disassemble -j __ksymtab /boot/vmlinux-2.4.2
It's a little bit more complicated when you have MODVERSIONS
turned on, but the concept is the same.
 see the top of
More information about the ILUG