Problems with EXPORT_SYMBOLS()

Problems with EXPORT_SYMBOLS()

Post by Michael Palm » Fri, 19 Jan 2001 02:58:34



hello...

ive got a problem with the EXPORT_SYMBOL() macro. i have 2 modules. one
of them uses functions which the other module exports . everything
works fine as long as i leave the symbols global which i want to export
in the exporting module. i want to use EXPORT_SYMBOL() for this task,
so that i can use global symbols without them beeing exported to the
kernel symbol table (i cant use static declaration cause i need some
global vars). now when i try to use it this way (compile is a success)
the other module cant find the external references anymore.
EXPORT_SYMBOL_NOVERS() works.

-----can be ignored ------
i think it has something to do with the version information on
symbols . i havent declared MODVERSIONS or included
linux/modversions.h. if i use "nm" on the module object file i get the
right name for the symbols like:
000000  D symbol_exported
but after insmoding it and trying "ksyms" it is reported as:
d801e0dc  symbol_exported_R__symbol_exported
when i use global symbols or EXPORT_SYMBOLS_NOVERS() it is normal:
d801e0dc  symol_exported
i think this _R__xxx could be the reason that the other module cant
find the symbol ??? But i also read insmod manpage and they said if
modules are compiled without versioning the CRC information on symbols
will be ignored ??? ok it is no real CRC info in this case but i think
the whole string after_R will be ignored ??? i also read
linux/modules.h and i wondered about the way EXPORT_SYMBOLS is handled
if no versioning is used. for this case i would have expected that its
behaviour is like EXPORT_SYMBOLS_NOVERS.
-------------------------

i really want to get EXPORT_SYMBOLS working.
Could somebody help me please!!!!!!!!

Thanks in advance...Michael Palme

im sorry when suggestions are wrong but i havent much knowledge off the
internals.

P.S.: I ran kernel 2.2.14, 2.2.16, 2.2.18, 2.4.0 (i tried kernels with
and without version information on modules) and tested modutils 2.3.19
and 2.4.1; gcc is 2.95.2 machine x86

Sent via Deja.com
http://www.deja.com/

 
 
 

Problems with EXPORT_SYMBOLS()

Post by Michael Palm » Fri, 19 Jan 2001 02:58:19


hello...

ive got a problem with the EXPORT_SYMBOL() macro. i have 2 modules. one
of them uses functions which the other module exports . everything
works fine as long as i leave the symbols global which i want to export
in the exporting module. i want to use EXPORT_SYMBOL() for this task,
so that i can use global symbols without them beeing exported to the
kernel symbol table (i cant use static declaration cause i need some
global vars). now when i try to use it this way (compile is a success)
the other module cant find the external references anymore.
EXPORT_SYMBOL_NOVERS() works.

-----can be ignored ------
i think it has something to do with the version information on
symbols . i havent declared MODVERSIONS or included
linux/modversions.h. if i use "nm" on the module object file i get the
right name for the symbols like:
000000  D symbol_exported
but after insmoding it and trying "ksyms" it is reported as:
d801e0dc  symbol_exported_R__symbol_exported
when i use global symbols or EXPORT_SYMBOLS_NOVERS() it is normal:
d801e0dc  symol_exported
i think this _R__xxx could be the reason that the other module cant
find the symbol ??? But i also read insmod manpage and they said if
modules are compiled without versioning the CRC information on symbols
will be ignored ??? ok it is no real CRC info in this case but i think
the whole string after_R will be ignored ??? i also read
linux/modules.h and i wondered about the way EXPORT_SYMBOLS is handled
if no versioning is used. for this case i would have expected that its
behaviour is like EXPORT_SYMBOLS_NOVERS.
-------------------------

i really want to get EXPORT_SYMBOLS working.
Could somebody help me please!!!!!!!!

Thanks in advance...Michael Palme

im sorry when suggestions are wrong but i havent much knowledge off the
internals.

P.S.: I ran kernel 2.2.14, 2.2.16, 2.2.18, 2.4.0 (i tried kernels with
and without version information on modules) and tested modutils 2.3.19
and 2.4.1; gcc is 2.95.2 machine x86

Sent via Deja.com
http://www.deja.com/

 
 
 

1. Problem in EXPORT_SYMBOL.. Please Help!

Hi All
I am trying to resolve the problem of EXPORT_SYMBOL. I have raised this
question on newbies kernel list but no one replied. Hence I am posting
it here.
I am using kernel 2.4.18-14. Below is the listing of a simple test code.

**************************************
/*main.c*/

#include <linux/kernel.h>
#include <linux/module.h>

#if CONFIG_MODVERSION == 1
#define MODERVSION
#include <linux/modversions.h>
#endif

int print_func()
{
        printk("Entry point.\n");
        return 0;

EXPORT_SYMBOL(print_func);

int init_module()
{
        print_func();
        return 0;

void cleanup()
{
        printk("End of story.\n");

********************************************

********************************************
/*Makefile*/

export-objs     := main.o
CC=gcc
MAKE = make
KERNELDIR = /usr/src/linux-2.4.18-14
MODCFLAGS := --save-temps -Wall -D__KERNEL__ -DMODULE -DLINUX -DMODVERSIONS

main.o:         main.c
                $(CC) $(MODCFLAGS) -I$(KERNELDIR)/include -c main.c

clean:
        rm -fr *.o *.i *.s

***********************************************

And on compiling the error is as follows...

gcc --save-temps -Wall -D__KERNEL__ -DMODULE -DLINUX -DMODVERSIONS -I/usr/src/linux-2.4.18-14/include -c main.c
main.c:15: parse error before "this_object_must_be_defined_as_export_objs_in_the_Makefile"
main.c:15: warning: type defaults to `int' in declaration of `this_object_must_be_defined_as_export_objs_in_the_Makefile'
main.c:15: warning: data definition has no type or storage class

The error says export_ojbs must be defined. As you can see I have already defined them in the Makefile.

Pleaes help. I am kind of stucked in my project.

Thanks in advance..
Dp

make: *** [main.o] Error 1

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Modem Problems

3. EXPORT_SYMBOL problem, in networking code

4. The hazards of not playing with shared libraries

5. Q: EXPORT_SYMBOL

6. httpd: can't resolve symbol 'recvmsg'

7. __VERSIONED_SYMBOL and related EXPORT_SYMBOL error

8. SUN USER GROUP EAST COAST CONFERENCE & EXHIBITION, JUNE, BOSTON

9. 2.5.34 - EXPORT_SYMBOL(reparent_to_init) for module build

10. Move EXPORT_SYMBOL from kernel/ksyms.c to fs/namei.c

11. EXPORT_SYMBOL doesn't work

12. New: EXPORT_SYMBOL and depmod don't work well together with GCC 3.2.2

13. EXPORT_SYMBOL for chrdev_open 2.4.3