本文介绍了为什么不objdump的显示.bss中,.shstratab,和的.symtab部分.strtab?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前,我正在做我自己objdump的实施℃。
有关我的-s选项,我必须展示一个ELF文件的节的全部内容。
我做的很好,但我展示比真正的objdump的多个部分。
在事实上,它不输出文件的.bss,.shstrtab,和的.symtab部分.strtab
我环顾了SHDR结构的sh_flags价值,但我找不到任何逻辑...
为什么objdump的-s不显示这些板块?
解决方案
Objdump is based on libbfd
, which abstracts away many complexities of ELF, and was written when objects tended to only have three sections.
As such, objdump
is quite deficient. In addition to not showing you (some) existing sections, it may also "synthesize" sections that don't exist at all, and do other weird tricks. This is more of a libbfd
fault -- its abstraction layer simply doesn't tell objdump about the "missing" sections.
TL;DR: don't use objdump
. Use readelf
instead.
这篇关于为什么不objdump的显示.bss中,.shstratab,和的.symtab部分.strtab?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!