为什么不objdump的显示.bss中,.shstratab,和的.symtab部分.strtab? [英] Why does objdump not show .bss, .shstratab, .symtab and .strtab sections?

查看:739
本文介绍了为什么不objdump的显示.bss中,.shstratab,和的.symtab部分.strtab?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在做我自己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 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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