[PATCH] D128740: [RuntimeDyld] Fix R_AARCH64_TSTBR14 relocation

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 10:02:19 PDT 2022


yota9 created this revision.
yota9 added reviewers: rafauler, lhames.
Herald added subscribers: StephenFan, hiraditya, kristof.beyls.
Herald added a project: All.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Wrong mask was used to get branch instruction imm value.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128740

Files:
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp


Index: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
===================================================================
--- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -479,7 +479,8 @@
 
     *TargetPtr &= 0xfff8001fU;
     // Immediate:15:2 goes in bits 18:5 of TBZ, TBNZ
-    or32le(TargetPtr, (BranchImm & 0x0FFFFFFC) << 3);
+    or32le(TargetPtr, (BranchImm & 0x0000FFFC) << 3);
+
     break;
   }
   case ELF::R_AARCH64_CALL26: // fallthrough


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128740.440674.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220628/ce837f2e/attachment.bin>


More information about the llvm-commits mailing list