[DynInst_API:] [dyninst/dyninst] c7fcf8: symtab: place .shstrtab after all sections to avoi...


Date: Wed, 24 Jun 2026 13:48:47 -0700
From: bbiiggppiigg <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] c7fcf8: symtab: place .shstrtab after all sections to avoi...
  Branch: refs/heads/shstrtab-collision-fix
  Home:   https://github.com/dyninst/dyninst
  Commit: c7fcf8b83acd2b42f6e40206564cd37f6d8f4e47
      https://github.com/dyninst/dyninst/commit/c7fcf8b83acd2b42f6e40206564cd37f6d8f4e47
  Author: wuxx1279 <bbiiggppiigg@xxxxxxxxx>
  Date:   2026-06-24 (Wed, 24 Jun 2026)

  Changed paths:
    M symtabAPI/src/emitElf.C

  Log Message:
  -----------
  symtab: place .shstrtab after all sections to avoid offset overlap

addSectionHeaderTable placed the section-name table immediately after the
single caller-supplied section (shdr->sh_offset + sh_size). That chain does
not include sections positioned by a separate offset counter -- notably
.dynphdrs (the program header table, placed by createNewPhdrRegion via
currEndOffset). When .dynphdrs sits at a higher file offset than that
predecessor, .shstrtab (and e_shoff, which is derived from it) is given an
offset that overlaps .dynphdrs, so on write the section-name table and the
section header table clobber the program header table on disk -- producing
garbage program headers and corrupted section names in the output.

Place .shstrtab after the maximum end offset of every emitted (non-NOBITS)
section instead, so it never overlaps the program headers.

Co-Authored-By: Claude Opus 4.8 <noreply@xxxxxxxxxxxxx>



To unsubscribe from these emails, change your notification settings at https://github.com/dyninst/dyninst/settings/notifications
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] c7fcf8: symtab: place .shstrtab after all sections to avoi..., bbiiggppiigg <=