Re: [PATCH] remoteproc: elf_loader: bound the section header table

HyeongJun An <[email protected]>
Newsgroups org.kernel.vger.linux-remoteproc,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CAJciObH1ER73km1sf5RtjjoD+1cvcmxt4DsgX-n++=juDmo2Ow@mail.gmail.com>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.