MCJIT handle a few more simple x86 relocations for MachO.
authorJim Grosbach <grosbach@apple.com>
Mon, 16 Jan 2012 23:50:49 +0000 (23:50 +0000)
committerJim Grosbach <grosbach@apple.com>
Mon, 16 Jan 2012 23:50:49 +0000 (23:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148263 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp

index 81b2d17f885c97946c753d357d33c346f7fe840a..a3b4919f68b17e7c284a437b5de2b5676fc64c5a 100644 (file)
@@ -50,8 +50,13 @@ resolveX86_64Relocation(uintptr_t Address, uintptr_t Value, bool isPCRel,
   switch(Type) {
   default:
     llvm_unreachable("Invalid relocation type!");
+  case macho::RIT_X86_64_Signed1:
+  case macho::RIT_X86_64_Signed2:
+  case macho::RIT_X86_64_Signed4:
+  case macho::RIT_X86_64_Signed:
   case macho::RIT_X86_64_Unsigned:
   case macho::RIT_X86_64_Branch: {
+    Value += Addend;
     // Mask in the target value a byte at a time (we don't have an alignment
     // guarantee for the target address, so this is safest).
     uint8_t *p = (uint8_t*)Address;
@@ -61,13 +66,9 @@ resolveX86_64Relocation(uintptr_t Address, uintptr_t Value, bool isPCRel,
     }
     return false;
   }
-  case macho::RIT_X86_64_Signed:
   case macho::RIT_X86_64_GOTLoad:
   case macho::RIT_X86_64_GOT:
   case macho::RIT_X86_64_Subtractor:
-  case macho::RIT_X86_64_Signed1:
-  case macho::RIT_X86_64_Signed2:
-  case macho::RIT_X86_64_Signed4:
   case macho::RIT_X86_64_TLV:
     return Error("Relocation type not implemented yet!");
   }