【问题标题】:objdump - head ELF - Meaning of flags?objdump - 头部 ELF - 标志的含义?
【发布时间】:2011-03-08 17:12:37
【问题描述】:

$ objdump -f ./a.out

./a.out:     file format elf32-i386
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x080484e0

$ objdump -f function.o

function.o:     file format elf32-i386
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000

flags是什么意思(flags 0x00000011: OR flags 0x00000112:)? ELF 头文件中没有任何内容具有此标志。 e_flag 包含 0。

有人知道他的意思吗?

谢谢

【问题讨论】:

  • 您是否想弄清楚 EXEC_P、HAS_SYMS 等标志的含义?你的问题我不清楚。
  • flags 0x00000112:或flags 0x00000011的含义:

标签: objdump


【解决方案1】:

它们是 BFD 特定的位掩码。在 binutils 源代码树中,请参见 bfd/bfd-in2.h:

  /* BFD contains relocation entries.  */
#define HAS_RELOC      0x01

  /* BFD is directly executable.  */
#define EXEC_P         0x02
...
  /* BFD has symbols.  */
#define HAS_SYMS       0x10
...
  /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
     linker sets this by default, but clears it for -r or -n or -N).  */
#define D_PAGED        0x100

这些标志值不会出现在您的目标文件中;它们只是 libbfd 使用的内存中表示。

【讨论】:

    【解决方案2】:

    它们是 LibBFD 标志。 您正在尝试重新编码 objdump 吗? ... =)

    【讨论】:

      猜你喜欢
      • 2011-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-27
      • 1970-01-01
      • 2014-08-12
      • 1970-01-01
      • 2021-11-18
      相关资源
      最近更新 更多