[PATCH] D25069: Fix PREL31 relocation on ARM

Yichao Yu via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 1 16:05:47 PDT 2016


yuyichao updated this revision to Diff 73203.
yuyichao added a comment.

Fix bit31 mask....


https://reviews.llvm.org/D25069

Files:
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp


Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -463,7 +463,11 @@
 
   case ELF::R_ARM_NONE:
     break;
+    // Write a 31bit signed offset
   case ELF::R_ARM_PREL31:
+    *TargetPtr &= 0x80000000;
+    *TargetPtr |= (Value - FinalAddress) & ~0x80000000;
+    break;
   case ELF::R_ARM_TARGET1:
   case ELF::R_ARM_ABS32:
     *TargetPtr = Value;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25069.73203.patch
Type: text/x-patch
Size: 538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161001/1497e1b4/attachment.bin>


More information about the llvm-commits mailing list