简体   繁体   English

为什么我的 /proc/kallsyms 文件不包含 System.map 中的所有符号?

[英]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 ( Tt标志)的文本部分中只有符号,保存一两个符号,例如

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.

相关问题 /boot/System.map*中的符号地址与/ proc / kallsyms中的符号地址不同 - Symbol addresses in /boot/System.map* are not identical to those in /proc/kallsyms 尝试将 /proc/kallsyms 添加到 gdb 以进行 vmlinux 调试:`/proc/kallsyms':无法读取符号:无法识别文件格式 - Trying to add /proc/kallsyms into gdb for vmlinux debugging :`/proc/kallsyms': can't read symbols: File format not recognized System.map文件中地址的含义 - Meaning of address' in System.map file 为什么System.map没有针对小对象的初始化数据节的任何条目(全局) - Why System.map does not have any entries for initialized data section for small objects (global) 内核 sys_call_table 地址与 system.map 中指定的地址不匹配 - Kernel sys_call_table address does not match address specified in system.map 在/ proc / kallsyms中重复名称 - Repeating names in /proc/kallsyms Linux内核 - 为什么System.map中的函数地址是实时看到的地址之前的一个字节? - Linux Kernel - why a function's address in System.map is one byte preceding its address as seen in real time? kallsyms是否具有内核函数的所有符号? - Does kallsyms have all the symbol of kernel functions? / proc文件系统挂起我的系统 - /proc file system hangs my system 不导出/ proc / kallsyms中标有“T”的内核符​​号 - kernel symbol marked with “T” in /proc/kallsyms is not exported
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM