Linux 内核导出符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10070861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:41:29  来源:igfitidea点击:

Linux kernel exported symbols

linuxlinux-kernel

提问by beparas

I want to check the list of symbol exported by the Linux kernel. So I fire the command,

我想检查 Linux 内核导出的符号列表。所以我发出命令,

# cat /proc/kallsyms
0000000000000000 D per_cpu__irq_stack_union
0000000000000000 D __per_cpu_start
0000000000004000 D per_cpu__gdt_page
0000000000005000 d per_cpu__exception_stacks
000000000000b000 d per_cpu__idt_desc
000000000000b010 d per_cpu__xen_cr0_value
000000000000b018 D per_cpu__xen_vcpu
000000000000b020 D per_cpu__xen_vcpu_info
000000000000b060 d per_cpu__mc_buffer
000000000000c570 D per_cpu__xen_mc_irq_flags

This is the output I got. My question is that, what is the meaning of each field in this output? The first field looks like the address, I didn't get any reference for second field. Can anybody explain to me the meaning of the values, D,d,t,T,s in second field?

这是我得到的输出。我的问题是,此输出中每个字段的含义是什么?第一个字段看起来像地址,我没有得到第二个字段的任何参考。任何人都可以向我解释第二个字段中值 D,d,t,T,s 的含义吗?

采纳答案by geekosaur

The characters in the second column have the same meaning they do in the output from nm:

第二列中的字符具有与以下输出中相同的含义nm

DdThe symbol is in the initialized data section.

SsThe symbol is in an uninitialized data section for small objects.

TtThe symbol is in the text (code) section.

Dd该符号位于已初始化的数据部分。

Ss该符号位于小对象的未初始化数据段中。

Tt该符号位于文本(代码)部分。

Uppercase symbols are global/exported; lowercase are local unexported symbols.

大写符号是全局/导出的;小写是本地未导出的符号。