From: LLVM Packaging Team Date: Fri, 13 Oct 2017 21:42:29 +0000 (+0100) Subject: fix-R_AARCH64_MOVW_UABS_G3-relocation X-Git-Tag: archive/raspbian/1%3.9.1-19+rpi1^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=907a62c236008b3562d72aa4cad0817869c113b8;p=llvm-toolchain-3.9.git fix-R_AARCH64_MOVW_UABS_G3-relocation Gbp-Pq: Name fix-R_AARCH64_MOVW_UABS_G3-relocation.patch --- diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index 9cbdb13a..9a347fe3 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -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;