Skip to content
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

ARMv4T (GBA) and ARMv6K (3DS) support #75

Merged
merged 36 commits into from
Jun 21, 2024
Merged

Conversation

AetiasHax
Copy link
Contributor

I've implemented support for v4T (GBA) and v6K (3DS) and tested with agbcc and armcc. Both compilers emit the .ARM.attributes section, which makes it possible to auto-detect the ARM version being used. Parsing the section was more complicated than I was hoping, so I developed a new crate called arm-attr to do the magic for us.

Since mwcc (DS compiler) doesn't emit the attributes section, the ARM version falls back to v5TE when no version info is found. If needed, there's a dropdown in "Arch Settings" to override any auto-detection.

agbcc sets the LSB for Thumb symbols, which meant that all Thumb code was shifted over by one byte and got displayed wrong. To solve this, I've added ObjArch::symbol_address which is called when resolving symbols, and ObjArchArm overrides the default behavior by clearing the LSB.

Copy link
Owner

@encounter encounter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far. Just a couple questions.

objdiff-core/src/obj/read.rs Outdated Show resolved Hide resolved
objdiff-core/src/arch/arm.rs Outdated Show resolved Hide resolved
@encounter
Copy link
Owner

Thanks a ton for this work!

@encounter encounter merged commit 9798116 into encounter:main Jun 21, 2024
10 checks passed
@AetiasHax AetiasHax deleted the arm branch June 23, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants