[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unresolved symbol during insmod
Hi everyone,
this has been discussed many times on the list, and i
went through most of them and could'nt find an answer
to my problem.
I am trying to call 2 system call functions from my
modules program. The system calls are sys_mount and
sys_rename.
I have exported both these function using
EXPORT_SYMBOL() and both of these symbols appear both
in System.map as well as /proc/ksyms. I am
implementing the module on a 2.4.22 kernel.
----snip-----
# grep sys_mount /boot/System.map-2.4.22
c015ed10 T sys_mount
c03426f7 R __kstrtab_sys_mount
c034fd30 R __ksymtab_sys_mount
# grep sys_rename /boot/System.map-2.4.22
c01518b0 T sys_rename
c03426c2 R __kstrtab_sys_rename
c034fd20 R __ksymtab_sys_rename
#
# cat /proc/ksyms | grep sys_mount
c015ed10 sys_mount_R__ver_sys_mount
# cat /proc/ksyms | grep sys_rename
c01518b0 sys_rename_R__ver_sys_rename
#
----snap-----
When i try to insert the module, i get the following
error message:
----snip-----
# insmod mod.o
mod.o: unresolved symbol sys_rename
mod.o: unresolved symbol sys_mount
mod.o:
Hint: You are trying to load a module without a GPL
compatible license
and it has unresolved symbols. Contact the
module supplier for
assistance, only they can help you.
#
----snap-----
The nm output of the module shows that the symbols are
undefined.
----snip----
# nm mod.o
...
...
U sys_mount
U sys_rename
#
----snap----
The command that i used to compile the module was:
---snip---
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c mod.c
-I/lib/modules/`uname -r`/build/include/
---snap---
I am not able to get this module working due to this
error. I am not able to understand why the symbols are
still undefined ?? do i need to add it to any special
header files ?? any suggestions would be really
helpful
Karthik
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/