Skip to content

Conversation

@trufae
Copy link
Collaborator

@trufae trufae commented Apr 29, 2024

This PR fixes the R_ARM_CALL relocation handling in ELF binaries for ARM architecture.

Previously, when applying relocations with bin.relocs.apply=true or bin.cache=true, instructions with relocated addresses were incorrectly disassembled as 'stmdaeq' instead of the correct 'bl' instruction.

The fix removes debug prints and hardcoded values from the relocation code, ensuring proper calculation of the addend for R_ARM_CALL relocations.

Tested with media_clock.ko kernel module, which now correctly shows 'bl' instructions after relocation application.

Closes #22822

@trufae trufae force-pushed the arm-call-reloc branch 3 times, most recently from 6843a81 to 8b6217e Compare May 3, 2024 17:01
@trufae trufae force-pushed the arm-call-reloc branch 2 times, most recently from a75d14a to 144b79d Compare May 23, 2024 10:08
@trufae trufae added this to the 5.9.6 - corteza milestone Aug 2, 2024
@trufae trufae modified the milestones: 5.9.8 - gigglebytes, 6.0.0 Nov 19, 2024
@trufae trufae modified the milestones: 6.0.0, 6.0.2 Jul 30, 2025
@trufae trufae modified the milestones: 6.0.4, 6.0.6 Sep 22, 2025
Remove debug prints and hardcoded values from R_ARM_CALL relocation handling.
This fixes the issue where instructions with relocated addresses were replaced with stmdaeq.
@trufae trufae changed the title WIP: Fix R_ARM_CALL relocs Fix R_ARM_CALL relocs Nov 17, 2025
@trufae trufae modified the milestones: 6.0.6, 6.0.8 Nov 19, 2025
@trufae trufae closed this Nov 25, 2025
@trufae trufae deleted the arm-call-reloc branch November 30, 2025 17:09
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.

Instructions with relocated addresses are replaced with stmdaeq

3 participants