Repository navigation
[ARM] Implement R_ARM_LDC_PC_G1 relocation - #2069
Draft
Deepak Shirke (deepakshirkem) wants to merge 2 commits into
Draft
Deepak Shirke (deepakshirkem) wants to merge 2 commits into
Deepak Shirke (deepakshirkem) wants to merge 2 commits into
Conversation
R_ARM_LDC_PC_G0 was previously unsupported. Add a shared LDC PC-group relocation handler with group 0 selection. The relocation computes S + A - P, selects the G0 residual, encodes the sign in U, and encodes the scaled 8-bit immediate, reporting overflow when the selected residual does not fit the supported range. Add standalone tests covering positive and negative PC-relative offsets and overflow handling, along with a runtime test using a VLDR PC-relative load. Update the ARM relocation documentation for R_ARM_LDC_PC_G0 support. Signed-off-by: deepakshirkem <deepakshirke509@gmail.com>
R_ARM_LDC_PC_G1 was previously unsupported. Reuse the shared LDC PC-group relocation handler with group 1 selection. The relocation computes S + A - P, derives the implicit addend from the U bit and scaled imm8 field, selects the G1 residual, and encodes the result back into the instruction. The residual must be 4-byte aligned and fit in the [0, 1023] range. Add standalone positive, negative, and overflow coverage, along with a runtime test using R_ARM_ALU_PC_G0_NC and R_ARM_LDC_PC_G1. Update the ARM relocation documentation to mark R_ARM_LDC_PC_G1 as supported. Signed-off-by: deepakshirkem <deepakshirke509@gmail.com>
Contributor
Author
|
Once G0 lands, I’ll drop the G0 commit and rebase onto main for review. Thank you :)) |
Steven Ramirez Rosa (Steven6798)
self-requested a review
October 5, 2026 19:19
Steven Ramirez Rosa (Steven6798)
left a comment
Contributor
There was a problem hiding this comment.
Looks good. I'll review and approve as soon as the R_ARM_LDC_PC_G0 patch lands.
This branch has not been deployed
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.
R_ARM_LDC_PC_G1was previously mapped to the unsupported relocation handler. This change implements the relocation by reusing the shared LDC PC-group handler with group 1 selection.The relocation uses:
S + A - PU:imm8Ubit for the signimm8for the scaled 8-bit immediate[0, 1023]Fixes #2070
Part of #2001
CC: Steven Ramirez Rosa (@Steven6798)