8

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 Answer 1

10

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.

2
  • Ah, I was aware of the section header structure, but that seemed a bit cryptic to me. Thanks.
    – Jeenu
    Commented Apr 8, 2013 at 7:12
  • Why is sh_addralign needed at all? Doesn't sh_addr already specify where the segment goes into memory? Or is it to specify alignment of things inside of the segment? Commented May 24, 2015 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.