Repository navigation
[AUTOMATED] fix(analysis): keep gap-walk starts out of the code a PPC64 ELFv1 symbol sizes - #1976
Merged
Merged
Conversation
…64 ELFv1 symbol sizes
Resolves the stage-count conflicts with Noelo-Lab#1975: the corpus count is 928 (927 + kuna-elfv1-symbolextent), and docs/baseline-stages.json is re-recorded on the merged tree (5,480 assertions: main's 5,474 plus this stage's 6). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…case
The fixtures README now names the --hash-style=both default of the toolchain that
built elfv1_symbol_extent_{be,le}.so: with it spelled out, Ubuntu's
powerpc-linux-gnu-gcc -m64 (GCC 13.3, GNU ld 2.42) rebuilds both files byte for
byte. Spec 01 adds GMP's assembly as a source of 24-byte descriptor sizes and
says a function whose code is itself 24 bytes filters nothing, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Contributor
|
[AUTOMATED] Pushed two commits on top of e9d901e, without force:
No code changed. |
mahaloz
pushed a commit
that referenced
this pull request
Nov 26, 2026
… call or descriptor names (#1993) Since #1976, a PowerPC64 ELFv1 descriptor symbol's size bounds the code that its validated descriptor names, so pattern and gap-walk starts inside it are dropped. This change refines that rule in three ways. First, a descriptor symbol's size is left out only when a sized symbol at its code states its own size, as the `.name` symbols of the dot-symbol ABI do. A function whose code is exactly 24 bytes is therefore bounded too, and keeps its body and result. Second, a descriptor symbol whose code word does not validate gives no extent. Third, a start inside another function's extent is kept when something other than a guess names it: the code word of a descriptor at any aligned .opd word, or the target of a `bl`. The Listing walk does not follow the body of an exported ELFv1 function, so such a call or descriptor may be the only evidence for that start. The PPC64 stub matcher is marked #[inline]. This keeps its per-word scan inlined: without the hint, `functions` on PowerPC64 images ran about 2.4% more instructions. The kuna-elfv1-symbolextent stage and the elfv1_symbol_extent fixtures gain a 24-byte function, a call from an uncalled export and a descriptor with no symbol, in both byte orders. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
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.
The problem
On PowerPC64 ELFv1, kuna can name a second function inside an exported one, whose body then ends there and loses its result. The symbol states the function's size, but its address is a descriptor in
.opd, so the size was read as that of the bytes after the descriptor.kuna functionsalso listssub_cf8, 12 bytes into the 28-bytesample. With--option aif offit returnsa0 + 0x10007, ora0for zero.The fix
-mcall-aixdesc) gives every descriptor its own size, and the.namesymbol at the code states the function's.Tests
kuna-elfv1-symbolextent.xmlcovers both byte orders: the false start and the lost result fail without the fix. Controls keep a routine with no symbol, a symbol and a call target inside another function, and a routine behind a descriptor that states its own size. No existing expectation moved.Over 1,494 ELFv1 images the fix removes 1,010 starts, all strictly inside an unwind range and none a call target, and adds none. Stripped copies of the 1,458 up to 3 MB lose 464, all likewise. 2,610 other files list the same functions.