Uh oh!
There was an error while loading. Please reload this page.
Fix MachO adrp/add and branch relocations with embedded addend - #124083
Conversation
These cannot have any addend embedded in the instruction and must instead be handled via a additional reloc entry. The object writer already knows how to create these reloc entries, but it was leaving the embedded addend in the intstruction in some cases.
jakobbotsch
commented
Feb 6, 2026
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the MachO object writer where ARM64 relocations (ADRP/ADD and BRANCH26) were incorrectly leaving embedded addends in the instruction encoding. According to the MachO format specification for ARM64, these relocation types cannot have addends embedded in the instruction - instead, addends must be communicated through separate ARM64_RELOC_ADDEND relocation entries.
Changes:
- Added IMAGE_REL_BASED_ARM64_BRANCH26 to the case statement handling ARM64 relocations that require addend extraction and clearing
- Ensured that any existing addend value embedded in the BRANCH26 instruction is read out, accumulated into the
addendvariable, and then the instruction is cleared to zero
jkotas
commented
Feb 6, 2026
Can we re-enable the test disabled against the fixed issue? |
jakobbotsch
commented
Feb 6, 2026
Thanks, reenabled that. |
jakobbotsch
commented
Feb 6, 2026
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
The LLVM code at https://github.com/llvm/llvm-project/blob/3a084241248efd7d5259183cffae1d5b7057a54c/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp#L355-L382 does it for Branch26 as well, but in my tests the embedded addends for those appear to be fine, so I have left that out. Edit: The documentation is quite clear to use |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jakobbotsch
commented
Feb 9, 2026
The runtime-nativeaot-outerloop osx-arm64 failure looks related, but I cannot reproduce it locally after running in a loop for a while. |
jakobbotsch
commented
Feb 9, 2026
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
jakobbotsch
commented
Feb 9, 2026
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
## Description This PR fixes several failures encountered in extra-platforms pipeline: - Updates `ZipMergedPayloadDirectory` target to use `PreparePayloadDirectories` instead of `PrepareMergedTestPayloadDirectories`, which was inlined in #123110. This should fix Apple mobile runtime tests - Includes StandaloneTestRunner markers used for Native AOT mobile tests - Excludes test markers for shared libraries on Android - Disables unreliable socket tests on Apple mobile Native AOT builds will be fixed in #124083 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jakobbotsch
commented
Feb 9, 2026
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jakobbotsch
commented
Feb 10, 2026
/ba-g Timeout and unmatched dotnet/dnceng#6457 |
1 similar comment
jakobbotsch
commented
Feb 10, 2026
/ba-g Timeout and unmatched dotnet/dnceng#6457 |
Uh oh!
There was an error while loading. Please reload this page.
…t#124000) ## Description This PR fixes several failures encountered in extra-platforms pipeline: - Updates `ZipMergedPayloadDirectory` target to use `PreparePayloadDirectories` instead of `PrepareMergedTestPayloadDirectories`, which was inlined in dotnet#123110. This should fix Apple mobile runtime tests - Includes StandaloneTestRunner markers used for Native AOT mobile tests - Excludes test markers for shared libraries on Android - Disables unreliable socket tests on Apple mobile Native AOT builds will be fixed in dotnet#124083 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t#124083) These cannot have any addend embedded in the instruction and must instead be handled via a additional reloc entry. The object writer already knows how to create these reloc entries, but it was leaving the embedded addend in the instruction in some cases. Fixdotnet#124015
These cannot have any addend embedded in the instruction and must instead be handled via a additional reloc entry. The object writer already knows how to create these reloc entries, but it was leaving the embedded addend in the instruction in some cases.
Fix#124015