[llvm] [JITLINK]Fix endiannes issue with MachO_ptrauth_noolloc_sections.yaml (PR #167902)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 06:02:05 PST 2025


https://github.com/anoopkg6 updated https://github.com/llvm/llvm-project/pull/167902

>From 58344397ac8af6ed39fd82b63f8d0b0c114f8aed Mon Sep 17 00:00:00 2001
From: anoopkg6 <anoopkg6 at github.com>
Date: Thu, 13 Nov 2025 17:18:18 +0100
Subject: [PATCH] Fix endiannes issue with MachO_ptrauth_noolloc_sections.yaml

---
 .../ExecutionEngine/JITLink/MachOLinkGraphBuilder.h    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
index 91021e457532e..bcba62dddbc8b 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
@@ -169,11 +169,11 @@ class MachOLinkGraphBuilder {
         getObject().getRelocation(RelItr->getRawDataRefImpl());
     MachO::relocation_info RI;
     RI.r_address = ARI.r_word0;
-    RI.r_symbolnum = ARI.r_word1 & 0xffffff;
-    RI.r_pcrel = (ARI.r_word1 >> 24) & 1;
-    RI.r_length = (ARI.r_word1 >> 25) & 3;
-    RI.r_extern = (ARI.r_word1 >> 27) & 1;
-    RI.r_type = (ARI.r_word1 >> 28);
+    RI.r_symbolnum = getObject().getPlainRelocationSymbolNum(ARI);
+    RI.r_pcrel = getObject().getAnyRelocationPCRel(ARI);
+    RI.r_length = getObject().getAnyRelocationLength(ARI);
+    RI.r_extern = getObject().getPlainRelocationExternal(ARI);
+    RI.r_type = getObject().getAnyRelocationType(ARI);
     return RI;
   }
 



More information about the llvm-commits mailing list