RuntimeDyldELF: add R_AARCH64_ADD_ABS_LO12_NC reloc

Differential revision: https://reviews.llvm.org/D28115

llvm-svn: 290598
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index a977dce..fea9320 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -453,6 +453,15 @@
     support::ulittle32_t::ref{TargetPtr} = TargetValue;
     break;
   }
+  case ELF::R_AARCH64_ADD_ABS_LO12_NC: {
+    // Operation: S + A
+    uint64_t Result = Value + Addend;
+
+    // Immediate goes in bits 21:10 of LD/ST instruction, taken
+    // from bits 11:0 of X
+    *TargetPtr |= ((Result & 0xfff) << 10);
+    break;
+  }
   case ELF::R_AARCH64_LDST32_ABS_LO12_NC: {
     // Operation: S + A
     uint64_t Result = Value + Addend;