← Back to Pull requests

Add support for Mach-O ARM64_RELOC_POINTER_TO_GOT #929

Merged
wesleywiser merged 4 files (5 lines) on Jul 02, 2026 00:32 UTC
View on GitHub
wesleywiser wesleywiser commented on Jul 01, 2026 02:38 UTC
Author

In addition to the automated test, I manually ran the objdump example against proper objdump which showed equivalent output for a variety of files.

Diff: 5 lines (+4 / -1) across 4 files Reviewer: philipc Review duration: 1313m
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.18) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.18 · 5 lines diff across 4 files
0.18
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 3 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
86%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.107
Real PR Conversation Timeline
6 items
philipc philipc commented on code on Jul 01, 2026 03:31 UTC
Code Review
src/write/macho/object.rs:1
@@ -357,6 +357,10 @@ impl<'a> Object<'a> {
                 (K::PltRelative, E::Generic | E::AArch64Call) => {
                     (true, macho::ARM64_RELOC_BRANCH26)
                 }
+                (K::GotRelative, E::Generic) => {
+                    reloc.addend -= reloc.offset as i64;

Why is this needed?

philipc philipc commented on Jul 01, 2026 03:34 UTC
Reviewer

What's your use case for this? These relocation kinds/encodings will never be complete, so I like to have an understanding of what is required.

wesleywiser wesleywiser commented on code on Jul 01, 2026 18:00 UTC
Code Review
src/write/macho/object.rs:1
@@ -357,6 +357,10 @@ impl<'a> Object<'a> {
                 (K::PltRelative, E::Generic | E::AArch64Call) => {
                     (true, macho::ARM64_RELOC_BRANCH26)
                 }
+                (K::GotRelative, E::Generic) => {
+                    reloc.addend -= reloc.offset as i64;

Sorry, this was left over from a previous attempt to implement this and I forgot to remove it.

wesleywiser wesleywiser commented on Jul 01, 2026 18:04 UTC
Author

I was trying to use the object crate to write CIE entries referring to the personality function for macos binaries which, in my testing, uses ARM64_RELOC_POINTER_TO_GOT on this platform. With this change, I'm able to write those entries correctly and unwinding the stack works.

philipc philipc approved these changes on Jul 02, 2026 00:31 UTC
Approved Reviewer

Thanks!

Reviewers
Assignees
wesleywiser wesleywiser
Labels
risk: low confidence: 86.9% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 18.1% (LOW) · Higher = larger blast radius
18.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 86.9% · Lower = rushed or shallow review
86.9%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 2.4% · Safe to merge
2.4%