On Thu, Aug 20, 2026 at 1:44 AM Mathieu Poirier
<[email protected]> wrote:
> I would assume that if e_shnum is 0, then e_shstrndx would also be 0.

They are independent.  e_shnum goes to 0 when the section count reaches
SHN_LORESERVE.  e_shstrndx goes to SHN_XINDEX when the string table's own
index reaches SHN_LORESERVE.  One keys off the total, the other off one
section's index, so a conforming image with many sections and its name
string table at a low index has e_shnum 0 and a small e_shstrndx.

scripts/recordmcount.h:219 set_shnum() zeroes e_shnum from the count alone
and never touches e_shstrndx.

Thanks.

Reply via email to