Insmod gives unsresolved symbol
Hi
I am trying to write a device driver which calls certain functions/variables from the kernel (e.g. ipv4_explicit_null from /usr/src/linux/net/mpls/mpls_init.c )
But when I try to insert the module using insmod it gives me an error saying unresolved symbol ipv4_explicit_null
thinking the kernel did not export the said symbol I added EXPORT_SYMBOL(ipv4_explicit_null) in the file mpls_init.c
Now I can see the symbol in System.map
but my problem still persists.
Am I exporting symbols properly or is there anything else that needs to be done .
please advise
thanks in anticipation,
amit
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
Quoted 11 lines · It was a dark and stormy night. Suddenly "Amit Kulkarni
Hi
I am trying to write a device driver which calls certain functions/variables from the kernel (e.g.
ipv4_explicit_nullfrom/usr/src/linux/net/mpls/mpls_init.c)But when I try to insert the module using insmod it gives me an error saying unresolved symbol
ipv4_explicit_null
Quoted 8 lines
thinking the kernel did not export the said symbol I added
EXPORT_SYMBOL(ipv4_explicit_null)in the filempls_init.c
Now I can see the symbol in System.map
but my problem still persists.Am I exporting symbols properly or is there anything else that needs to be done .
I assume that you're trying to build a module outside the regular kernel build system. You can do this if you are carefull.
Look carefully at the symbol in the System.map file. Is it EXACTLY the "ipv4_explicit_null" symbol? Are the extra characters after the "...null" part of the name? Any extra characters mean that you've got module versioning turned on in your kernel, so exported symbols have their name mangled somewhat as C++ would do (this is to implement some protection since modules from one kernel version probably won't work with another kernel version). The easiest solution to this is to recompile your kernel with module versioning turned off.
---------------------------------------------+-----------------------------
Tommy Reynolds | mailto: <[email protected]> Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286 307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.256.837.3839 Senior Software Developer | Mobile: +1.919.641.2923
In system.map there are no other charachters except ipv4_explicit_null the line isc03c4900 B ipv4_explicit_null
same is true for all other symbols I added.
I am not sure what B indicates
Quoted 31 lines · --- Tommy Reynolds
It was a dark and stormy night. Suddenly "Amit
Quoted 8 lines · Kulkarni
Hi
I am trying to write a device driver which calls
certain functions/variables from the kernel
(e.g.ipv4_explicit_nullfrom/usr/src/linux/net/mpls/mpls_init.c)But when I try to insert the module using insmod
it
Quoted 4 lines
gives me an error saying unresolved symbol
ipv4_explicit_nullthinking the kernel did not export the said symbol
I
Quoted 1 line
added
EXPORT_SYMBOL(ipv4_explicit_null)in thefile
Quoted 5 lines
mpls_init.c
Now I can see the symbol in System.map
but my problem still persists.Am I exporting symbols properly or is there
anything
Quoted 1 line
else that needs to be done .
I assume that you're trying to build a module
outside the regular kernel build
system. You can do this if you are carefull.
Quoted 16 lines
Look carefully at the symbol in the System.map file.
Is it EXACTLY the
"ipv4_explicit_null" symbol? Are the extra characters after the "...null" part
of the name? Any extra characters mean that you've got module versioning turned
on in your kernel, so exported symbols have their name mangled somewhat as C++
would do (this is to implement some protection since modules from one kernel
version probably won't work with another kernel version). The easiest solution
to this is to recompile your kernel with module versioning turned off.
---------------------------------------------+-----------------------------
Quoted 11 lines
Tommy Reynolds |
mailto: <[email protected]>
Red Hat, Inc., Embedded Development Services |
Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX:
+1.256.837.3839
Senior Software Developer |
Mobile: +1.919.641.2923ATTACHMENT part 2 application/pgp-signature
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com