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

Use comments to apply relocations to certain instructions #165

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

1superchip
Copy link
Contributor

Addresses #161

This is an attempt to fix an issue with the assembler not emitting relocations to static functions.

This may cause issues when absolute values are used such as in this scratch: https://decomp.me/scratch/KBprJ
The input assembly of the scratch is bl 4 which objdump disassembles to image

How asm-differ outputs this with my changes:
image

Other instructions could be added but would cause issues such as conditional/unconditional branches to labels within functions
This scratch has labels which the assembler emits: https://decomp.me/scratch/hKpwa

objdump of the input assembly from the scratch:
image
These branch instructions have a comment which matches the comment regex that is used in AsmProcessorPPC.pre_process so the offsets (which we want) would get replaced with the label if these instructions are included.

This is why AsmProcessorPPC.pre_process checks for bl

diff.py Outdated Show resolved Hide resolved
diff.py Outdated Show resolved Hide resolved
@simonlindholm simonlindholm merged commit 79a8bbe into simonlindholm:main Jun 13, 2024
4 checks passed
1superchip added a commit to 1superchip/decomp.me that referenced this pull request Oct 6, 2024
mkst pushed a commit to decompme/decomp.me that referenced this pull request Oct 7, 2024
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