[ARM] Implement R_ARM_THM_PC8 relocation - #1776
Open
Deepak Shirke (deepakshirkem) wants to merge 1 commit into
Open
[ARM] Implement R_ARM_THM_PC8 relocation#1776Deepak Shirke (deepakshirkem) wants to merge 1 commit into
Deepak Shirke (deepakshirkem) wants to merge 1 commit into
Conversation
Deepak Shirke (deepakshirkem)
requested a review
from quic-areg
as a code owner
August 27, 2026 12:56
Steven Ramirez Rosa (Steven6798)
self-requested a review
August 27, 2026 14:37
Contributor
|
Deepak Shirke (@deepakshirkem) remember to update the docs when a new relocation is added. |
R_ARM_THM_PC8 was previously unsupported. Implement the apply function using formula S + A - P per ARM IHI0044: - Extract addend from 16-bit Thumb instruction imm8 field - Positive offset only (no U bit) - 10-bit range [0, 1023], must be 4-byte aligned - Encode result as imm8 = val >> 2 in bits[7:0] Signed-off-by: deepakshirkem <deepakshirke509@gmail.com>
Deepak Shirke (deepakshirkem)
force-pushed
the
fix/arm-thm-pc8-1337
branch
from
August 27, 2026 15:56
d4f7e0f to
9b2b8bb
Compare
Deepak Shirke (deepakshirkem)
requested a review
from Shakti Suman (quic-shaksuma)
as a code owner
August 27, 2026 15:56
Steven Ramirez Rosa (Steven6798)
approved these changes
Aug 28, 2026
Shakti Suman (quic-shaksuma)
approved these changes
Aug 28, 2026
Shankar Easwaran (quic-seaswara)
requested changes
Aug 28, 2026
| pReloc.issueUnsignedOverflow(pParent, val, 0, 0x3fc); | ||
| return ARMRelocator::Overflow; | ||
| } | ||
| if (val & 0x3) |
Contributor
There was a problem hiding this comment.
Why is BadReloc returned here ? Do we have a test ?
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.
Implement the
applyfunction forR_ARM_THM_PC8using the formulaS + A - Pper ARM IHI0044. The result is encoded asimm8 = val >> 2in the 16-bit Thumb LDR/ADR literal instruction (bits[7:0]). Only positive 4-byte aligned offsets in range [0, 1023] are permitted.Fixes #1337
CC: Steven Ramirez Rosa (@Steven6798)