Skip to content

Fix ELF symbol indexing for explicit sections#62

Merged
maleadt merged 1 commit into
masterfrom
tb/fix_elf_symbol_indexing
Jul 7, 2026
Merged

Fix ELF symbol indexing for explicit sections#62
maleadt merged 1 commit into
masterfrom
tb/fix_elf_symbol_indexing

Conversation

@maleadt

@maleadt maleadt commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

ELFSymbols can be constructed directly from a section, such as .dynsym, but the generic Symbols.getindex path read entries from symtab_entry_offset(handle(syms)). For ELF that re-runs Symbols(oh) and usually selects .symtab, leaving explicit .dynsym objects with entries read from .symtab and names resolved through .dynstr.

Add an ELF-specific getindex method that reads from Section(syms), preserving the symbol table selected by Symbols(section). This fixes explicit .dynsym indexing semantics and also avoids repeatedly rediscovering the object-level preferred table on large binaries.

Cover the regression with bundled ELF fixtures by checking a known .dynsym entry.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.94%. Comparing base (26ff9b8) to head (3416629).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
+ Coverage   69.75%   69.94%   +0.19%     
==========================================
  Files          46       46              
  Lines        1362     1364       +2     
==========================================
+ Hits          950      954       +4     
+ Misses        412      410       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ELFSymbols can be constructed directly from a section, such as .dynsym, but the generic Symbols.getindex path read entries from symtab_entry_offset(handle(syms)). For ELF that re-runs Symbols(oh) and usually selects .symtab, leaving explicit .dynsym objects with entries read from .symtab and names resolved through .dynstr.

Add an ELF-specific getindex method that reads from Section(syms), preserving the symbol table selected by Symbols(section). This fixes explicit .dynsym indexing semantics and also avoids repeatedly rediscovering the object-level preferred table on large binaries.

Cover the regression with bundled ELF fixtures by checking a known .dynsym entry.
@maleadt maleadt force-pushed the tb/fix_elf_symbol_indexing branch from 0c16865 to 3416629 Compare July 7, 2026 19:15
@maleadt maleadt changed the title Fix ELF symbol indexing to avoid symtab rescans Fix ELF symbol indexing for explicit sections Jul 7, 2026
@maleadt maleadt merged commit 815c42e into master Jul 7, 2026
17 checks passed
@maleadt maleadt deleted the tb/fix_elf_symbol_indexing branch July 7, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant