为什么不objdump的显示.bss中,.shstratab,和的.symtab部分.strtab? [英] Why does objdump not show .bss, .shstratab, .symtab and .strtab sections?
问题描述
目前,我正在做我自己objdump的实施℃。
有关我的-s选项,我必须展示一个ELF文件的节的全部内容。
我做的很好,但我展示比真正的objdump的多个部分。
在事实上,它不输出文件的.bss,.shstrtab,和的.symtab部分.strtab
我环顾了SHDR结构的sh_flags价值,但我找不到任何逻辑...
为什么objdump的-s不显示这些板块?
为什么objdump的-s不显示这些板块?
块引用>objdump的是基于
libbfd
,它抽象了许多ELF的复杂性,并写入时的对象往往的只有的有三个部分。因此,
objdump的
是相当的缺陷的。除了不能显示你(某些)现有路段,它也可能合成不存在于一切,做其他的怪异招数部分。这更是一个libbfd
故障 - 它的抽象层根本不告诉objdump的关于丢失的部分。TL; DR:不使用
objdump的
。使用readelf
代替。I'm currently doing my own objdump implementation in C.
For my -s option, I have to show the full contents of the section of an ELF file.
I'm doing it well, but i'm showing more sections than the "real" objdump.
In fact, it does not output the .bss, .shstrtab, .symtab and .strtab sections.
I'm looking around the sh_flags value on the Shdr struct but I can't find any logic...
Why objdump -s does not shows these sections ?
解决方案Why objdump -s does not shows these sections ?
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 alibbfd
fault -- its abstraction layer simply doesn't tell objdump about the "missing" sections.TL;DR: don't use
objdump
. Usereadelf
instead.这篇关于为什么不objdump的显示.bss中,.shstratab,和的.symtab部分.strtab?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!