Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp =================================================================== --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -374,6 +374,11 @@ write(isBE, TargetPtr, static_cast(Result & 0xffffffffU)); break; } + case ELF::R_AARCH64_PREL64: { + uint64_t Result = Value + Addend - FinalAddress; + write(isBE, TargetPtr, Result); + break; + } case ELF::R_AARCH64_CALL26: // fallthrough case ELF::R_AARCH64_JUMP26: { // Operation: S+A-P. Set Call or B immediate value to bits fff_fffc of the Index: test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s =================================================================== --- test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s +++ test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s @@ -27,13 +27,15 @@ .p2align 3 k: .xword f - .size k, 8 + .xword f - . + .size k, 16 # rtdyld-check: *{4}(g) = 0xd2e02460 # rtdyld-check: *{4}(g + 4) = 0xf2c8ace0 # rtdyld-check: *{4}(g + 8) = 0xf2b13560 # rtdyld-check: *{4}(g + 12) = 0xf299bde0 # rtdyld-check: *{8}k = f +# rtdyld-check: *{8}(k + 8) = f - (k + 8) ## f & 0xFFF = 0xdef (bits 11:0 of f) ## 0xdef << 10 = 0x37bc00