-->

What is the meaning of the ES, Lk, Inf and Al colu

2020-07-18 11:24发布

问题:

In the outupt of readelf -S, I'd like to know what the column headers ES, Lk, Inf and Al mean.

For example:

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:

I'd like to know what the column headers ES, Lk, Inf and Al

Look in /usr/include/elf.h, for definition of Elf32_Shdr. You'll see something like this:

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;

So, a reasonable guess would be: ES == sh_entsize, Lk == sh_link, Inf == sh_info and Al == sh_addalign.



标签: elf