ELF核心文件格式 [英] ELF core file format
问题描述
这是我想要做的:将虚拟地址映射到可执行文件/库中的函数名包括运行过程。为此,我首先想从核心文件中找出映射从虚拟地址空间到可执行文件/库的名称,然后挖掘相关文件以获取符号信息。
现在'readelf -a core'告诉我几乎核心文件中的所有段都是'load'类型 - 我猜这些是.text和.bss来自所有参与文件的数据段,以及一个堆栈段。除了这些加载段以外,还有一个音符段,但似乎并不包含地图。那么存储在核心文件中的关于哪个段对应的文件的信息如何?这些加载段以特定的方式格式化以包含文件信息?
没有那么多 gdb
作为 gdb
使用的 bfd
库, binutils
等。
Short of digging through GDB source, where can I find documentation about the format used to create core files?
The ELF specification leaves the core file format open, so I guess this should be part of the GDB specifications! Sadly, I did not find any help in this regard from GNU's gdb documentation.
Here's what I am trying to do: Map virtual addresses to function names in executable/libraries that comprised the running process. To do that, I would first like to figure out, from the core file, the map from virtual address space to the name of the executable file/libraries, and then dig into the relevant file to get the symbolic information.
Now 'readelf -a core' tells me that nearly all the segments in the core file are of the type 'load' -- I'd guess these are the .text and .bss/.data segments from all the participating files, plus a stack segment. Barring these load segments, there is one note segment, but that does not seem to contain the map. So how is the information about which file a segment corresponds to, stored in the core file? Are those 'load' segments format in a particular way to include the file information?
Not so much gdb
as the bfd
library used by gdb
, binutils
, etc.
这篇关于ELF核心文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!