Repository navigation
Conversation
Two ARM reference-walk rules, each behind a default-on option: - armpltslot: a GNU ld A32 PLT stub (adr ip; add ip,ip,#N; ldr pc,[ip,#M]!) files its GOT slot as a Read and no longer files the PC value or the mapped N<<12 immediate as Data rows. - armcondskip: the CBRANCH to the next instruction that SLEIGH puts ahead of a predicated instruction files no Jump, unless it is the one way into the next function's entry. Rebased onto main as one commit (the earlier 30-commit history sat on the pre-squash branch-tables layer). With armpltslot off the slot's Read now comes from regcarry, so the off test expects it. docs/options.md and the stages baseline are regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main now names synthesized structures as a serial run does, so the callee-first order these rows change no longer renumbers struct_N. On ARM musl libc.so, its stripped copy and libstdc++.so the output is byte-identical with both options on and off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
On ARM,
kuna xrefsfiles two kinds of rows that are not references: a PLT stub files the partial sums it builds its GOT slot's address from, and every predicated instruction (ldrne,moveq,popeq {..,pc}, anything in a Thumbitblock) files a jump to the next instruction.printf@pltisadd ip,pc,#0,12; add ip,ip,#0x12000; ldr pc,[ip,#0xcf4]!; only the slot0x2300cis a reference.pickiscmp r1,#0; ldrne r0,[r0,#4]; ldreq r0,[r0]; bx lr. The fixture comes with this PR. With it, the first command gives only thereadrow and the second none.armpltslot(listing/kuna_pltstub.rs): inside.pltand.ipltonly, the walk follows a register set to a constant, one or two adds of a constant, then a load through it that aBRANCHINDtakes. The chain files no constantdatarow; the slot'sreadstays. Any other shape keeps the constant scan's rows.armcondskip: aCBRANCHto the instruction's own fall-through ahead of its other ops (Classified::condition_skip) stays a flow for every walk but files no row, as in Ghidra.bneto the next line keeps its jump, and so does a skip from an instruction with no fall-through (bxne lr,ldrne pc,addls pc) into another function's entry, since it is the one way in.--option armpltslot off --option armcondskip offgives main's rows. Other architectures do not change.Against IDA on three stripped ARM executables, rows kuna files that IDA does not go 1203 → 35, 308 → 49 and 737 → 12; no row IDA and kuna shared is lost.
decompile-alloutput is byte-identical to main on 107 ARM ELF files (musllibc.so,libstdc++.so,libgomp.soand the repo's ARM fixtures among them), except one function that hits the 120 s budget on both sides.Tests:
verify_xreffp.rs(xreffp_arm_le32, plusxreffp_strip_arm_le32andxrefiplt_arm_le32built from assembly) checks one slot row and no partial rows for three PLT stubs and an.ipltstub, no jump from nine predicated instructions, the kept jumps above, and both options off.kuna_pltstubunit tests cover the shapes that break a chain.tests/stages/kuna-armpltslot.xmlandkuna-armcondskip.xmlpin that each option parses and leaves the console's C unchanged.Speed (CPU, median of 5, main → this PR):
kuna strings1.02 → 1.03 s on x86-64 musllibstdc++.so, 1.06 → 1.06 s and 0.53 → 0.52 s on ARM musllibstdc++.soandlibc.so;kuna xrefs --to memcpywithin ±0.01 s on all three.🤖 Generated with Claude Code