fix-R_AARCH64_MOVW_UABS_G3-relocation
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Fri, 22 Dec 2017 10:17:30 +0000 (10:17 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Fri, 22 Dec 2017 10:17:30 +0000 (10:17 +0000)
Gbp-Pq: Name fix-R_AARCH64_MOVW_UABS_G3-relocation.patch

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

index 9cbdb13a3572aefdd209061a2d168a6bb8df3a1d..9a347fe332bc4b2b7f25a8327f081b2c94b49561 100644 (file)
@@ -357,7 +357,7 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section,
     // bits affected by the relocation on entry is garbage.
     *TargetPtr &= 0xffe0001fU;
     // Immediate goes in bits 20:5 of MOVZ/MOVK instruction
-    *TargetPtr |= Result >> (48 - 5);
+    *TargetPtr |= (Result & 0xffff000000000000ULL) >> (48 - 5);
     // Shift must be "lsl #48", in bits 22:21
     assert((*TargetPtr >> 21 & 0x3) == 3 && "invalid shift for relocation");
     break;