- 论坛徽章:
- 1
|
一个内核模块编译时有个warning,可以生成模块,但是加载时不能加载,出错:
start_info_page: Unknown symbol _text (err 0)
代码如下,很简单:- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <xen/page.h>
- extern int _text;
- static int start_info_page_init(void)
- {
- struct xenstore_domain_interface * xenstore;
- printk(KERN_DEBUG "start_info_page_address: %p\n", xen_start_info);
- // printk(KERN_DEBUG "pseudo_physical_memory: %lu\n", machine_to_phys_mapping[xen_start_info->store_mfn]);
- xenstore = (struct xenstore_domain_interface *)((machine_to_phys_mapping[xen_start_info->store_mfn] << 12) + ((unsigned long) &_text));
- printk(KERN_DEBUG "xen store mfn: %p\n", xenstore);
- return 0;
- }
- static void start_info_page_exit(void)
- {
- printk(KERN_DEBUG "exit\n");
- }
- module_init(start_info_page_init);
- module_exit(start_info_page_exit);
- MODULE_LICENSE("GPL");
复制代码 _text这个符号我在System.map中能够找的到,请问还有可能是哪个地方的问题? |
|