readelf -S输出中ES,Lk,Inf和Al列标题的含义是什么?

时间:2013-04-07 12:18:53

标签: elf

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
[...]

1 个答案:

答案 0 :(得分:5)

  

我想知道列标题ES,Lk,Inf和Al

是什么

查看/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