Seed r2 for ppc32 small-data so pdg resolves sdata globals ##ppc#251
Open
phix33 wants to merge 1 commit into
Open
Seed r2 for ppc32 small-data so pdg resolves sdata globals ##ppc#251phix33 wants to merge 1 commit into
phix33 wants to merge 1 commit into
Conversation
trufae
reviewed
Jun 23, 2026
| regname = r_reg_alias_getname (core->anal->reg, R_REG_ALIAS_GP); | ||
| if (!regname && r_str_startswith (acfg->arch, "ppc") | ||
| && acfg->bits == 64 && R_ARCH_CONFIG_IS_BIG_ENDIAN (acfg)) { | ||
| && (acfg->bits == 32 || acfg->bits == 64) |
Contributor
There was a problem hiding this comment.
What about dropping the bits check here? Is endian actually important for anything here? I mean theres no need to see if its ppc32 or ppc64 when there’s no ppc16 or ppc8. And i think this check also applies to little endian ppcs, right?
trufae
reviewed
Jun 23, 2026
| if (!regname && r_str_startswith (acfg->arch, "ppc") | ||
| && acfg->bits == 64 && R_ARCH_CONFIG_IS_BIG_ENDIAN (acfg)) { | ||
| && (acfg->bits == 32 || acfg->bits == 64) | ||
| && R_ARCH_CONFIG_IS_BIG_ENDIAN (acfg)) { |
Contributor
There was a problem hiding this comment.
This endian check can go away too
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.
Checklist
Description
Extends the global-pointer seed in
seedGlobalPointerRegisterfrom ppc64-only to ppc32 BE, sopdgresolvesr2-relative small-data loads to named globals instead of*(unaff_r2 + offset). Mirrors the radare2-sideanal.gpautoresolve (radare2 01b34f32f5); r2 holds the TOC base on ppc64 and the small-data base on ppc32.Adds two r2r tests (seeded resolves, unseeded bails) and a 564-byte ppc32 BE test binary.