[英]Why does my /proc/kallsyms file not contain all the symbols in System.map?
I saw from this SO post that /proc/kallsyms
should have the symbols of dynamically loaded modules as well as static code whereas System.map
contains only the symbols of static code.我从这篇 SO 帖子中看到
/proc/kallsyms
应该有动态加载模块的符号以及 static 代码,而System.map
只包含 ZA81259CEF8E959C6247DF1D456E5D39 代码的符号。 However, when I cat /proc/kallsyms
I seem to only have symbols in the text section of the kernel ( T
and t
flags), save one or two symbols like但是,当我
cat /proc/kallsyms
时,我似乎在 kernel ( T
和t
标志)的文本部分中只有符号,保存一两个符号,例如
0000000000000000 D irq_stack_union
0000000000000000 D __per_cpu_start
On the other hand, in System.map
I have symbols from many sections - essentially everything from /proc/kallsyms
except loaded kernel module symbols.另一方面,在
System.map
中,我有来自许多部分的符号 - 基本上来自/proc/kallsyms
的所有内容,除了加载的 kernel 模块符号。
To show the magnitude of this difference I used the wc
command.为了显示这种差异的大小,我使用了
wc
命令。
user@debian:~/$ cat /boot/System.map-3.2.0-4-amd64 | wc
51256 153768 2117121
user@debian:~/$ cat /proc/kallsyms | wc
29336 92637 1161409
What is the reason for this difference?造成这种差异的原因是什么? Where are all of the data section related symbols in my
/proc/kallsyms
file?我的
/proc/kallsyms
文件中所有与数据部分相关的符号在哪里?
Edit: As requested, here are the kallsyms
configuration options.编辑:根据要求,这里是
kallsyms
配置选项。
user@debian:~$ cat /boot/config-3.2.0-4-amd64 | grep KALLSYMS
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
You don't have CONFIG_KALLSYMS_ALL
set to y
, therefore only text symbols are exported to /proc/kallsyms
.您没有将
CONFIG_KALLSYMS_ALL
设置为y
,因此只有文本符号导出到/proc/kallsyms
。 Setting this to y
and re-building the kernel (although not that simple to do) should solve the problem.将其设置为
y
并重新构建 kernel(虽然不是那么简单)应该可以解决问题。
I don't know if this is because you have an old kernel or some distro that disables it in their build.我不知道这是否是因为您有旧的 kernel 或某些发行版在其构建中禁用了它。 You could also try upgrading to a newer kernel.
您也可以尝试升级到更新的 kernel。 In my Debian 9 Linux v4.9 it seems to be enabled.
在我的 Debian 9 Linux v4.9 中,它似乎已启用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.