Chinaunix

标题: linux 模块crc [打印本页]

作者: csdemo    时间: 2018-06-25 10:30
标题: linux 模块crc
阅读2.6代码时候,有个疑问,
在函数resolve_symbol->check_version函数中crc参数获值的问题,我追踪代码,怎么看到得到的是__crc_##sym的地址,而不是它本身的crc值呢?



#define __CRC_SYMBOL(sym, sec)                  \   
    extern void *__crc_##sym __attribute__((weak));     \  
    static const unsigned long __kcrctab_##sym      \  
    __used                          \  
    __attribute__((section("__kcrctab" sec), unused))   \  
    = (unsigned long) &__crc_##sym;  

作者: 夏尾鱼    时间: 2018-06-25 15:02
帮你顶上去等待大佬回复
作者: csdemo    时间: 2018-06-25 16:50
http://bbs.chinaunix.net/thread-4186531-1-1.html
这里有一些信息,只是在看源码时体现的是获得值是地址值,而不是crc值。
作者: csdemo    时间: 2018-07-03 11:24
其实在ld链接文件中,已用crc值作为一个abs地址。解决。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2