Chinaunix首页 | 论坛 | 博客
  • 博客访问: 37094
  • 博文数量: 8
  • 博客积分: 476
  • 博客等级: 下士
  • 技术积分: 145
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-11 15:53
文章分类
文章存档

2012年(1)

2011年(5)

2010年(2)

我的朋友

分类: LINUX

2012-02-29 16:08:37

模块1需要使用模块2的函数,但是有时候install 后出现Unknown symbol.以下是查到的资料
(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
来自.
如果以后的方法你试过了还是不行,那么有可能是少加了MODULE_LICENSE("GPL");
当然最重要的是先确定模块2已经安装了。我之前就是在安装KVM_MOD的时没有先安装kvm.ko,直接安装kvm-intel.ko,出现了大量的UnKnowns symbol.
阅读(982) | 评论(0) | 转发(0) |
0

上一篇:小结

下一篇:没有了

给主人留下些什么吧!~~