-
-
Notifications
You must be signed in to change notification settings - Fork 122
Support gp relocations for Psy-Q AS 2.5x #1888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change introduces two new relocation types, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Parser
participant Relocation
participant Display
User->>Parser: Load object file
Parser->>Parser: Identify relocation type (including GPREL16_BE/LE)
Parser->>Relocation: Pass relocation info for ELF generation
Relocation->>Relocation: Adjust offset & write bytes based on type
Parser->>Display: Format relocation strings for output
Display-->>User: Present parsed relocation details
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used🪛 GitHub Check: CodeScene Cloud Delta Analysis (main)tools/psyq-obj-parser/psyq-obj-parser.cc[warning] 344-351: ❌ Getting worse: Complex Method [warning] 1198-1463: ❌ Getting worse: Complex Method [warning] 1198-1198: ❌ New issue: Complex Conditional [warning] 1198-1463: ❌ Getting worse: Complex Method ⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :)
I'm not sure what version of object files the current tool targets (could be newer or older) but at least with 2.5x of the Psy-Q assembler (1996-1997), it generates gp relocations not supported. They are code 12 for big-endian and code 30 for little-endian. These relocations are handled slightly differently from the other GP type, in this case
sdata
uses an absolute value whereassbss
goes by symbol name, both reference the section start point.This adds support for them so that the tool can convert their relevant objects for use on decomp.me. Also note that I'm not a C++ wizard so the code may not be the best, but it works in my testing.