From 0b9462167b1fb8c29d082de034643d9a675da22b Mon Sep 17 00:00:00 2001 From: Jason Hiser <jdhiser@gmail.com> Date: Thu, 27 Dec 2018 20:58:50 -0500 Subject: [PATCH] fixed adr offset distance --- unpin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpin.cpp b/unpin.cpp index 9671f36..6a03fb8 100644 --- a/unpin.cpp +++ b/unpin.cpp @@ -362,8 +362,8 @@ void Unpin_t::DoUpdateForInstructions() const auto imm21_ext = (((int64_t)imm21)<<43) >> 43; // sign extend to 64-bit const auto shift_dist= - is_adrp_type ? 12 : // bits in page - is_adr_type ? 2 : // bits in instruction + is_adrp_type ? 12 : // bits in page for adrp + is_adr_type ? 0 : // no shift for adr throw invalid_argument("Unknown adr insn"); const auto orig_insn_pageno = orig_insn_addr>>shift_dist; -- GitLab