[RuntimeDyld] Fix stub size and offset for AArch64 in RuntimeDyldMachO.h.
authorLang Hames <lhames@gmail.com>
Sat, 12 Jul 2014 00:16:47 +0000 (00:16 +0000)
committerLang Hames <lhames@gmail.com>
Sat, 12 Jul 2014 00:16:47 +0000 (00:16 +0000)
<rdar://problem/17648000>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212864 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h

index 35f072080838bb93d85dd2dc8d69ec177749aed8..24dc5674d46e0b72831914d3fda45d3b6b5ea22c 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "ObjectImageCommon.h"
 #include "RuntimeDyldImpl.h"
-#include "llvm/ADT/IndexedMap.h"
 #include "llvm/Object/MachO.h"
 #include "llvm/Support/Format.h"
 
@@ -56,11 +55,20 @@ private:
       return 8; // 32-bit instruction and 32-bit address
     else if (Arch == Triple::x86_64)
       return 8; // GOT entry
+    else if (Arch == Triple::arm64)
+      return 8; // GOT entry
     else
       return 0;
   }
 
-  unsigned getStubAlignment() override { return 1; }
+  unsigned getStubAlignment() override {
+    if (Arch == Triple::arm || Arch == Triple::thumb)
+      return 4;
+    else if (Arch == Triple::arm64)
+      return 8;
+    else
+      return 1;
+  }
 
   relocation_iterator processSECTDIFFRelocation(
                                              unsigned SectionID,