Repository navigation
[AUTOMATED] fix(analysis): every ELF name at a function's address selects that function - #751
Merged
Merged
Conversation
phix33
force-pushed
the
fix/arm-thumb-symbol-aliases
branch
from
September 30, 2026 00:14
5c45e4a to
c3e76b3
Compare
phix33
force-pushed
the
fix/arm-thumb-symbol-aliases
branch
from
September 30, 2026 01:01
c3e76b3 to
3841ecf
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TzSHsg8KAakpogyVw5dtjG
…t reported names Retaining every ELF name in the loader's symbol stream let a later alias outrank the first symbol-table name by entry_name_rank, so whole-binary output renamed functions (131 in the static-glibc mcount fixture, e.g. gsignal -> raise) while their callers still printed the old spelling. The loader now keeps its first-name-per-address stream and exposes the other distinct names through ObjectLoadImage::func_symbol_aliases; the console appends them to the canonical entry at the Thumb-normalized address, so name lookup reaches the definition while the reported name is unchanged. Adds a clang/ld.lld-built ARM veneer fixture and the stages test kuna-elfaliasnames.xml (fails on main: the exported name decompiled the PLT stub), moves the spec prose into the 1.2 loader text beside the definition-over-import rule, and re-records the stages baseline. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TzSHsg8KAakpogyVw5dtjG
…on's own name Review follow-up. A loader alias spelled like a different function's own name made that name ambiguous (a global alias `shared` of `twin` beside a static `shared`; 103 names in the sweep, e.g. libasound versioned names and chibios' chSysLockFromISR), breaking the promise that a name that selected a function still does. After the definition-over-import-stub rule, name lookup now drops the candidates it reaches only through a loader alias whenever another candidate remains, in both resolve_entry and find_entry_by_name. A loader alias whose address has no entry yet is still a candidate there, so the text path (no discovery) and --json agree. Adds the gcc-built elfaliasclash_x86_64 fixture to the stage test and a CLI test, tests the alias shift under adjust_vma, renames the CLI test to elf_symbol_aliases.rs, and documents ELF same-address names in docs/cli.md and the 1.2 spec text. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TzSHsg8KAakpogyVw5dtjG
Resolves the stage-corpus count (83 + 277 = 360) and re-records docs/baseline-stages.json from the merged tree. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TzSHsg8KAakpogyVw5dtjG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When several ELF symbols name one address, the loader kept only the first, so the others selected nothing or, when a PLT stub shared the name, the stub. Here
answershares its address with a local ARM veneer name and also labels a PLT stub, sokuna decompiledecompiles the stub:Fix
.symtab, PLT,.dynsymorder), the name call sites print. Every other distinct ELF name there, linked or relocatable, becomes a lookup-only alias of that entry.answernow selects the veneer. Otherwise an alias never outbids a function's own name: a staticsharedstill wins over another function's same-address aliasshared.xrefs --to answernow reports the definition, which is reached only through its PLT stub, so it lists no callers. Main already answers that way for a plaingcc -sharedlibrary.Tests
tests/stages/kuna-elfaliasnames.xml:answerdecompiles toreturn 7;(main decompiles the stub). In a gcc fixture wheresharedis both an alias oftwinand a static function,sharedstill selects the static one..symtab/.dynsymrepeats, thesharedclash throughdecompile,--jsonanddecompile-all --functions.decompile-alloutput do not change.🤖 Generated with Claude Code
https://claude.ai/code/session_01TzSHsg8KAakpogyVw5dtjG