mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #1741] [Feature] Add PowerPC (32-bit big-endian) native analysis through Ghidra, with a GameCube/Wii DOL follow-up #584
Open
opened 2026-10-15 18:26:24 +00:00 by bsakaguchi
·
14 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
morluto/rea#584
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arielfikru on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1741
Before submitting
Area
Native analysis or decompilation
Current limitation
BINARY_ARCHITECTURESinsrc/domain/binaryTargetTypes.tscurrently admitsx86,x86_64,arm,arm64andmips. A 32-bit big-endian PowerPC ELF (EM_PPC) therefore cannot reach REA's Ghidra workflow, even though Ghidra ships PowerPC language support. The same applies to Nintendo GameCube/Wii executables (DOL), which are PowerPC 750CL-family (Gekko/Broadway) code with paired-single floating-point instructions.Use cases
Static investigation of PowerPC code through REA's ordinary native workflow: functions, instructions, pseudocode, references and Evidence. Concrete cases:
I have been doing this on a Wii title with Ghidra headless scripts outside REA, which is where the notes below come from.
Desired outcome and success criteria
Milestone 1: generic PowerPC ELF, following the shape of the MIPS lane (
docs/ghidra-mips.md):EM_PPC, big-endian,ET_EXEC, and keep a provider-neutralpowerpcfamily through target classification, analysis profile and Evidence.EM_PPC64, little-endian, relocatable/shared objects, VLE) rather than guessing a profile.PowerPC:BE:32:defaultlanguage; record the observed language/compiler spec in Evidence.tests/conformance/c/ppc.cplus a probe with fixedaddi/bcencodings), cross-compiled for a generic 32-bit big-endian PPC target; no third-party binaries.Milestone 2: GameCube/Wii DOL (could be a separate issue):
r2/r13, SDA2/SDA) when they can be derived from the entry stub, because without them most global accesses decompile as raw offsets.Authority boundaries and non-goals
No emulation (Dolphin), no disc image handling (ISO/RVZ/WBFS), no REL/RSO relocation in the first milestone, no matching-decompilation or compiler integration, no game-specific logic, no automatic extension installation. Analysis stays read-only and targets stay caller-supplied.
Alternatives considered
PowerPC:BE:32:Gekko_Broadwaylanguage. In my use (an earlier release, not yet re-checked with 1.3.1) its loader opened a dialog during headless import and failed withHeadlessException. That matters because REA drives Ghidra headless. The workaround that worked: convert the DOL to an ELF with its section addresses and entry, then import it as ELF with-processor "PowerPC:BE:32:Gekko_Broadway"; the extension is still needed for that language.dtk) already splits DOLs and can emit ELF; it is a good reference for header parsing but is a separate tool with its own workflow.Possible direction
Milestone 1 mirrors the MIPS lane: header parsing in the ELF resolver, a
powerpcfamily in the domain types, a Ghidra profile entry, averify:ghidra:ppcreal-provider lane anddocs/ghidra-ppc.md. Milestone 2 adds a DOL target kind; the open question for maintainers is whether REA should (a) parse the DOL itself and hand Ghidra an equivalent ELF/raw-binary import with explicit addresses and the Gekko/Broadway language, keeping the extension bring-your-own only for the language, or (b) rely on the extension's loader once its headless behaviour is confirmed.The
powerpcfamily from milestone 1 is meant to be reused by later, separate lanes (for example Wii U RPX, which is still 32-bit PowerPC, or PPC64 targets) without widening this issue's scope.I'm happy to implement milestone 1 and open a PR if the direction fits. I can run the real-provider lane on macOS with Ghidra 12.1.4 and JDK 17/21.
References
docs/ghidra-mips.md, #718src/domain/binaryTargetTypes.ts@arielfikru commented on GitHub (Oct 11, 2026):
One data point that supports pinning the language in milestone 1, plus a small correction.
Ghidra's automatic choice for a plain PowerPC ELF is e500, not the generic 32-bit language. I built a freestanding fixture (the MIPS fixture with the names changed) and imported it headless:
Ghidra 12.1.4 log:
e500 is the embedded Book-E/SPE variant without the classic FPU, so for 750-family code (which uses ordinary FP instructions) it is the wrong interpretation. With
e_flags0 there is nothing in the header that distinguishes the two, so the lane should selectPowerPC:BE:32:defaultexplicitly and record it in the profile, the same way the MIPS lane binds its declared interpretation, rather than accept the loader's pick.Correction: Ghidra 12.1.x requires JDK 21 (
application.java.min=21), not 17. As a baseline, the existingnpm run verify:ghidra:mipslane passes on this macOS (arm64) host with Ghidra 12.1.4 + JDK 21, Homebrew clang 23 + lld and GNU readelf 2.47.@casesolved-co-uk commented on GitHub (Oct 12, 2026):
They just implemented the ability to supply a user defined architecture when using ghidra via #1868 which ties in with this feature.
Unfortunately they only added x86 and arm architectures.
I would also like to see PowerPC architectures added, but also all architectures supported by ghidra.
My own use case is 32bit PowerPC BE with VLE for the MPC5565 (Marelli 8F3 Fiat engine ECU)
@morluto @mvanhorn please?
@mvanhorn commented on GitHub (Oct 15, 2026):
Agreed on both points. The PowerPC lane should explicitly select
PowerPC:BE:32:defaultfor this profile instead of relying on Ghidra's e500 default, and the prerequisite should be JDK 21 for Ghidra 12.1.x. Broader architecture coverage, including VLE and the other Ghidra-supported languages, is a worthwhile follow-up beyond the initial x86/ARM support.@CassieFox23 commented on GitHub (Oct 18, 2026):
TL;DR: Part one of this request works on main now. I tested it on Linux. Part two, the GameCube/Wii DOL format, is not done yet.
Milestone 1, 32-bit big-endian PowerPC ELF, is fixed on main by
c86b09a10(#1747).32f0e5120by hand. Then 10 of 27 tests fail on Node 22.23.1, 24.18.0 and 26.11.1, withunsupported ELF architectureamong them.Not run: the real Ghidra lane (
verify:ghidra:ppc) and a real PowerPC binary.What was taken out, and the tests
Taken out: the EM_PPC case in
elfFixedHeader.ts, thepowerpcentry and dispatch in the Ghidra provider, and the PowerPC profile links.Tests:
src/domain/binaryTarget.powerpc.test.ts,src/ghidra/GhidraPowerPcProfile.test.ts,tests/composition/analysis-sessions/powerpc-identity.test.ts,tests/conformance/ghidra/ppc-checks.test.ts.Thanks, arielfikru, for the clear report and the patch.
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊
@arielfikru commented on GitHub (Oct 19, 2026):
The real Ghidra lane passes on current main, so the gap noted above ("Not run: the real Ghidra lane") is closed.
npm run verify:ghidra:ppcon main ate4c3d7239: exit 0, about 26 s.PowerPC:BE:32:default, compiler specdefault(the pin holds; no e500 fallback).Host: macOS 26.6.2 arm64, Ghidra 12.1.4, OpenJDK 21.0.12, Homebrew clang 23.1.3 + lld, GNU readelf 2.47, Node 24.18.0.
So milestone 1 is verified with a real provider. I would like to start milestone 2 (GameCube/Wii DOL); a short design proposal follows in a separate comment.
@arielfikru commented on GitHub (Oct 19, 2026):
Proposal for milestone 2 (GameCube/Wii DOL). I would like agreement on the shape before writing it, because it touches the import path and not just a profile.
Why the existing lanes don't fit. A DOL has no magic, and its 7 text and 11 data sections each load at their own address, plus a BSS range. The raw-binary lane from #1868 maps the whole file contiguously at one base through
BinaryLoader, so it would place every section at the wrong address. The stock Ghidra loaders have no DOL support. The GameCube-Loader extension (Cuyler36, Apache-2.0) does, but its loader opens a dialog and throwsHeadlessExceptionunderanalyzeHeadless(seen on Ghidra 12.1.4).Proposed shape
format: "gamecube-dol", caller-supplied likeraw-binary(never inferred, since there is no magic). A pure parser insrc/domainreads the 0x100-byte header and rejects these cases: offsets or sizes outside the file, overlapping sections, unaligned text, addresses outside0x80000000..0x81800000, and an entry point not inside a text section.BinaryLoaderplus a newReaGhidraPrepareDol.javapre-script. It rebuilds the memory map from the parsed table (text r-x, data rw-, BSS uninitialized) and sets the entry point. This follows thePrepareRaw/PrepareCompattern, with no third-party loader.PowerPC:BE:32:defaultby default, because it ships with Ghidra. Known limit: Gekko/Broadway paired-single instructions (psq_l,ps_*) do not decode there. That is documented indocs/ghidra-dol.md. If the installed catalog hasPowerPC:BE:32:Gekko_Broadway(from the GameCube-Loader extension, language only, loader unused), a caller can select it throughREA_GHIDRA_LANGUAGE_ID. The lane tests that override path as well as the default.ppc.cfixture. A small script turns its ELF segments into a DOL at0x80003100, so no game binary is involved. The independent cross-check: the expected section table and bytes come fromreadelfon the source ELF and are compared with what Ghidra reports. The real lane isverify:ghidra:dol.Out of scope for this milestone: small-data anchors.
r13/r2are not in the header; they come fromlis/oripairs in the startup code. I would propose that as a follow-up, either caller-supplied or detected, together with REL modules and Wii U RPX.Questions:
gamecube-dolan acceptable format name, or would you preferdol?@mvanhorn commented on GitHub (Oct 19, 2026):
Agreed on this shape:
gamecube-dolmakes the explicit format selection clear, and rebuilding the section map through a pre-script fits the noncontiguous layout.The optional extension language through
REA_GHIDRA_LANGUAGE_IDis acceptable, with the stock language as the default and the paired-single limitation documented. Keep the stock verification lane runnable without the extension, and make override coverage conditional on that language being installed.The parser should also validate address-plus-size bounds and BSS overlap with loaded sections. Small-data anchors, REL, and RPX make sense as separate follow-ups.
@WyattTheSkid commented on GitHub (Oct 20, 2026):
Don't forget about IDA!
@CassieFox23 commented on GitHub (Oct 20, 2026):
TL;DR: Milestone 1 works on Linux with the real Ghidra lane.
npm run verify:ghidra:ppcpassed on main90e433df0. They match the numbers arielfikru gave. The three PowerPC profile tests I worried about earlier pass on main.Thanks, arielfikru, for running the real lane first. This is a second check on a different box. Milestone 2 is out of scope here.
90e433df0npm run verify:ghidra:ppcAbout the three tests: in my earlier check on the Refs commit
c86b09a10, three tests insrc/ghidra/GhidraPowerPcProfile.test.tsfailed. They cover the e500 language pick, a configured language, and header flags. The full names are in the fold below. On main that file passes 10 of 10 on all three Node versions. They already passed on main on Oct 18, so this is not a new fix. I did not rerun the Refs commit.arielfikru ran it at
e4c3d7239. Main is now 137 commits past that. The PowerPC files I compared were identical between the two. I did not read the changes toGhidraInstallation.tsandGhidraPeProfile.ts.Not run
The three tests
binds the generic language instead of the loader's e500 choicelets a configured language replace the lane defaultcommits header flags so a changed interpretation changes the profileCommands
The 23.9 s covers the whole
npm run, including a cached build and the clang build of the fixture. The box was shared with other jobs.Test setup
90e433df0🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊
@arielfikru commented on GitHub (Oct 23, 2026):
A maintainer scope decision is needed before #6240 can be integrated. The earlier agreement in this thread came from a contributor. Could a maintainer confirm the shape below, or narrow it?
gamecube-doltarget format, never auto-detected.BinaryLoaderplus a pre-script that rebuilds the section map.PowerPC:BE:32:default, with an optionalREA_GHIDRA_LANGUAGE_IDoverride.@mvanhorn commented on GitHub (Oct 24, 2026):
Could a maintainer confirm or narrow the scope for #6240: caller-selected
gamecube-dol, read-only import through Ghidra BinaryLoader plus a section-map pre-script, stockPowerPC:BE:32:defaultwith an optionalREA_GHIDRA_LANGUAGE_IDoverride, and IDA/Hopper declining the format? Target execution, injection, and mutation remain out of scope; small-data anchors, REL, and RPX remain follow-ups.@arielfikru commented on GitHub (Oct 24, 2026):
Follow-up proposal for the small-data anchors listed in #6240's out-of-scope notes. I'm asking for a maintainer scope decision before implementing.
Problem: a DOL imported through
gamecube-dolhas r2/r13 unset. Every small-data access (lwz r3,-0x1234(r13)) stays an unresolved register offset, so decompiled code loses its globals.Proposed shape:
lis rN,hi+ori/addi rN,rN,lopair for r2 and for r13, in the code reached from the header entry. Report each value with the address of the instruction pair that produced it. Ambiguity or absence fails closed: the anchor is reported as unknown and left unset, never guessed.__init_registers. The real lane checks the detected values and that a small-data load decompiles to its global's address.Evidence from a commercial Wii
main.dol: the pairs in__init_registersgive r13 =.sdata+ 0x8000 and r2 =.sdata2+ 0x8000, which matches the EABI convention.@mvanhorn commented on GitHub (Oct 25, 2026):
@morluto, one scope question on arielfikru's small-data anchor proposal above, so it can start once #6240 settles. Which of these would you take as the follow-up?
lis+ori/addipairs, allow a caller override, and set them as Ghidra context before analysis (the full proposal).Either way it would be a separate PR from #6240, read-only, with REL and RPX still out of scope.
@morluto commented on GitHub (Oct 26, 2026):
The requested generic PowerPC ELF lane landed in #1747, and explicit DOL import landed in #6240. I am keeping this issue open for the distinct remaining DOL work:
r2/r13small-data anchors are not recovered, and Gekko/Broadway decoding requires a separately installed language rather than being the stock default. The merged DOL PR reports its real Linux Ghidra run and explicitly notes that the Gekko pass was skipped; no additional provider run was performed in this triage.