Add missing THUMB_BRANCH24 and ARM64_BRANCH26 to Relocation.GetSize#128170
Merged
Conversation
These relocation types were handled in ReadValue/WriteValue but missing from GetSize, causing a NotSupportedException when PEObjectWriter resolves relocations during ARM/ARM64 composite R2R image emission. Fixes crossgen2 crash in runtime-coreclr crossgen2-composite pipeline on linux arm (Generate CORE_ROOT step). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run runtime-coreclr crossgen2-composite |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Crossgen2/CoreCLR tooling relocation metadata so Relocation.GetSize reports the correct span size for two instruction-immediate relocation kinds used on ARM/ARM64.
Changes:
- Add
RelocType.IMAGE_REL_BASED_THUMB_BRANCH24 => 4toRelocation.GetSize. - Add
RelocType.IMAGE_REL_BASED_ARM64_BRANCH26 => 4toRelocation.GetSize.
3 tasks
Member
Author
|
/azp run runtime-coreclr crossgen2-composite |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Resolve ARM branch relocations in PE images and avoid out-of-range Thumb branches for composite ARM exact method body calls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the speculative ARM composite-mode branch heuristic and keep PE relocation handling consistent with existing unchecked relocation resolution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run runtime-coreclr crossgen2-composite |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Use a non-branch relocation hint for exact composite method bodies on ARM so crossgen2 emits an address-load sequence instead of a Thumb BL that may exceed its immediate range. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
davidwrighton
approved these changes
May 19, 2026
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.
These relocation types were handled in ReadValue/WriteValue but missing from GetSize, causing a NotSupportedException when PEObjectWriter resolves relocations during ARM/ARM64 composite R2R image emission.
This doesn't fully fix the coreroot build because there are relocs from async variants to their resumption stubs which don't fit into these reloc sizes. A follow-up PR to place resumption stubs next to their async methods will fix that.