elf.5.html: Resolving confusion.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://man7.org/linux/man-pages/man5/elf.5.html

I see the fragment:

       A section header table index is a subscript into this array.  Some
       section header table indices are reserved: the initial entry and the
       indices between SHN_LORESERVE and SHN_HIRESERVE.  The initial entry
       is used in ELF extensions for e_phnum, e_shnum and e_strndx; in other
       cases, each field in the initial entry is set to zero.  An object
       file does not have sections for these special indices:

       SHN_UNDEF
              This value marks an undefined, missing, irrelevant, or other‐
              wise meaningless section reference.

I interpret it like this:

       A section header table index **(e_shstrndx)** is a subscript
into this array.  Some
       section header table indices are reserved:
       the initial entry **(index 0)**
       and the indices **from** SHN_LORESERVE **to** SHN_HIRESERVE **,
inclusive**.
       **Such reserved indices, except SHN_XINDEX (0xffff), cannot be
used in e_shstrndx.
       If e_shstrndx is SHN_XINDEX (0xffff) then the sh_link filed of
the initial ElfN_Shdr cannot contain such reserved indices.**
       The **three fields in the** initial entry ** - sh_info, sh_size
and sh_link - can be** used in ELF extensions for e_phnum, e_shnum and
**e_shstrndx correspondingly**. **If they are not used then they are
set to zero. All other fields of the initial entry are set to zero.**
       **The section header table entries with the following special
indices contain special values,         and in the ELF file there are
no sections associated with such entries.**

       SHN_UNDEF
              This value marks an undefined, missing, irrelevant, or other‐
              wise meaningless section reference.
              **This index can be 0 in which case it means the initial
ElfN_Shdr with a special meaning described above.**

Is such an interpretation correct?

---
Join us at C++Now 2020 in May!
Robin Kuzmin, CppNow Speaker Liaison, speakers@xxxxxxxxxx. Please
allow 2 - 4 days for my reply.

Robin Kuzmin, kuzmin.robin@xxxxxxxxx.
Please share your expert opinion about my recent posts:
* The Build System of My Dream (draft)
* Booleans




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux