快速业务通道

在Linux2.6.26下用EXPORT_SYMBOL时出现Unknown symbol?

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-04
Empire CMS,phome.net

Attachments



Description From amit jain 2009-01-14 05:53:57

Latest wo***ng kernel version:2.6.28

Earliest failing kernel version:2.6.26

Distribution:

Hardware Environment:

Software Environment:

Problem Description:

When you use driver dependent on other driver. It should load cleanely, if

other is loaded. But in kernel 2.6.26 onwards its give error, unknown symbol

found.

Actually find_symbol able to find symbol but check_version unable to match crc.

Because crc is not know to other driver. 



Steps to reproduce:

1) create two device drivers in two separate directories. let say hello and bye 

2) Export Symbol from hello module and try to use that in bye module.

3) Compile both the driver separately.

4) insmod hello.ko

3) While insmod(ing) bye.ko, gives error "Unknown Symbol found"
------- Comment #1 From Roland Kletzing 2009-01-17 02:44:19 -------

what about using modprobe instead ? (as this looks in modules.dep to find the

dependend modules and load them before) 
------- Comment #2 From sucheta 2009-01-18 21:40:43
Empire CMS,phome.net
-------

Hi Roland, using modprobe doesn''t work. The entries in modules.dep are added.

Still it ends up showing the same prints - "no symbol version for " and

"Unknown symbol ". And modprobe fails.
------- Comment #3 From amit jain 2009-01-19 00:20:32 -------

Hi Roland,

   Thanks a lot for replying. Below I have written details of experiments we

did and our understanding.



Problem: insmod failure for externally compiled module :-



Experiments:

(1) Compiling 2 modules a.ko and b.ko ( dependent on a.ko ) together :- Works



(2) Copying Module.symvers from module "a" dir to the module "b" dir, before

compiling b.ko :- Works.



(3) Modprobe after appending following lines in /lib/modules/modules.dep 

    /lib/modules/2.6.27.7-smp/kernel/drivers/net/a.ko

    /lib/modules/2.6.27.7-smp/kernel/drivers/net/b.ko:

/lib/modules/2.6.27.7-smp/kernel/drivers/net/a.ko

   :- Fails



(4) After compiling b.ko, just modifying b.mod.c file to include the undefined

symbol in its version table doesn''t work (didn''t expect to work ).



(5) export_objs (doesn''t work):

    In Makefile of a.ko:

       export_objs := a.ko / export-objs := a.ko / exportobjs := a.ko.



(6) Adding "#define EXPORT_SYMTAB" in a.c file (doesn''t work).



From above experiments, we found that In .mod.c file it maintains __versions

array, which contains export symbol name and its crc.

We see symbols of modules which are compiled with kernel. No symbols of

externally compiled modules.



The call trace is load_module -> simplify_symbols -> resolve_symbol -> 

find_symbol and check_version ( if find_symbol succeeds ).



check_version behavior comparison in 2.6.26 and earlier version kernels :-



In earlier versions of kernel also, symbol couldn''t be found in its version

table. Still, check_version used to 

return 1 (success) and the dependent module could be insmod(ed) successfully.



However, in kernel 2.6.26 onwards, behavior has changed.  check_version on not

finding the reqd. symbol in its version table returns 0 (fail) and  the

dependent external module can''t be inserted anymore.



Waiting eagerly for your reply. Thanks in advance.
------- Comment #4 From amit jain 2009-01-28 21:04:34
Empire CMS,phome.net
-------

Any updates ?
------- Comment #5 From Alan 2009-03-19 10:19:16 -------

No but this is not a support facility, just a bug tracker and as a problem only

you''ve reported and nobody else has duplicated its a very very low priority,

especially as its only out of tree code seeing it
------- Comment #6 From amit jain 2009-03-19 21:04:12 -------

It should not be very very low priotity, Its easy to reproduce. 

Its should be blocker bug, because anybody how will try to compile module

dependent on other module, will fail.



Strange, Why didn''t nobody reply on it.

I am really stuck, because of this problem.
------- Comment #7 From Tejun Heo 2009-03-19 21:48:40 -------

cc''ing Rusty Russell.
------- Comment #8 From Roland Kletzing 2009-03-20 12:11:23 -------

hello amit, 

i think alan is right. this seems a very specific, personal problem. 



anyway, if you think it`s a general kernel problem, please post an as simple as

possible repro-case (i.e. some sourcecode) for your problem, so chances will

raise that someone will look at your problem. 



i`d recommend bringing this up on kernel related mailing lists
------- Comment #9 From Rusty Russell 2009-03-22 23:00:51
Empire CMS,phome.net
-------

A typo, it should be

""modprobe --force-modversion" does NOT work for me, it will report "invalid

module

format""
------- Comment #12 From Rusty Russell 2009-06-04 06:54:15 -------

You can''t modprobe --force if  CONFIG_MODULE_FORCE_LOAD isn''t set.  That was

added in 2.6.26, and is off by default.



Hope that clarifies,

Rusty.

You need to log in before you can comment on or make changes to this bug.

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号