+2015-10-12  Yao Qi  <yao.qi@linaro.org>
+
+       * linux-aarch64-low.c (aarch64_relocate_instruction): Add
+       argument insn.  Remove local variable insn.  Don't call
+       target_read_uint32.
+       (aarch64_install_fast_tracepoint_jump_pad): Call
+       target_read_uint32.
+
 2015-09-30  Yao Qi  <yao.qi@linaro.org>
 
        * linux-aarch64-low.c (emit_movk): Shorten a long line.
 
   return rest == 0 || rest == -1;
 }
 
-/* Relocate an instruction from OLDLOC to *TO.  This function will also
-   increment TO by the number of bytes the new instruction(s) take(s).
+/* Relocate an instruction INSN from OLDLOC to *TO.  This function will
+    also increment TO by the number of bytes the new instruction(s) take(s).
 
    PC relative instructions need to be handled specifically:
 
    - LDR/LDRSW (literal)  */
 
 static void
-aarch64_relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
+aarch64_relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc, uint32_t insn)
 {
   uint32_t buf[32];
   uint32_t *p = buf;
-  uint32_t insn;
 
   int is_bl;
   int is64;
   unsigned bit;
   int32_t offset;
 
-  target_read_uint32 (oldloc, &insn);
-
   if (aarch64_decode_b (oldloc, insn, &is_bl, &offset))
     {
       offset = (oldloc - *to + offset);
   uint32_t *p = buf;
   int32_t offset;
   int i;
+  uint32_t insn;
   CORE_ADDR buildaddr = *jump_entry;
 
   /* We need to save the current state on the stack both to restore it
 
   /* Now emit the relocated instruction.  */
   *adjusted_insn_addr = buildaddr;
-  aarch64_relocate_instruction (&buildaddr, tpaddr);
+  target_read_uint32 (tpaddr, &insn);
+  aarch64_relocate_instruction (&buildaddr, tpaddr, insn);
   *adjusted_insn_addr_end = buildaddr;
 
   /* We may not have been able to relocate the instruction.  */