ELF核心文件格式 [英] ELF core file format

查看:178
本文介绍了ELF核心文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过GDB源代码进行挖掘,我可以在哪里找到有关用于创建核心文件的格式的文档? ELF 规范保留了核心文件格式,所以我想这应该是GDB规范的一部分!可悲的是,我从GNU的gdb文档中找不到这方面的任何帮助。



这是我想要做的:将虚拟地址映射到可执行文件/库中的函数名包括运行过程。为此,我首先想从核心文件中找出映射从虚拟地址空间到可执行文件/库的名称,然后挖掘相关文件以获取符号信息。



现在'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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆