6

在 的输出中readelf -S,我想知道列标题ESLkInfAl含义。

例如:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000034 00000d 00  AX  0   0  4
  [ 2] .rel.text         REL             00000000 000394 000008 08     10   1  4
  [ 3] .data             PROGBITS        00000000 000044 000000 00  WA  0   0  4
[...]
4

1 回答 1

7

我想知道列标题 ES、Lk、Inf 和 A​​l

在 /usr/include/elf.h 中查找 Elf32_Shdr 的定义。你会看到这样的东西:

typedef struct
{
  Elf32_Word    sh_name;                /* Section name (string tbl index) */
  Elf32_Word    sh_type;                /* Section type */
  Elf32_Word    sh_flags;               /* Section flags */
  Elf32_Addr    sh_addr;                /* Section virtual addr at execution */
  Elf32_Off     sh_offset;              /* Section file offset */
  Elf32_Word    sh_size;                /* Section size in bytes */
  Elf32_Word    sh_link;                /* Link to another section */
  Elf32_Word    sh_info;                /* Additional section information */
  Elf32_Word    sh_addralign;           /* Section alignment */
  Elf32_Word    sh_entsize;             /* Entry size if section holds table */
} Elf32_Shdr;

因此,一个合理的猜测是:ES== sh_entsizeLk== sh_linkInf==sh_infoAl== sh_addalign

于 2013-04-08T02:42:31.693 回答