From 786aad4b4bf9ea0992c9c4dd8645d01589d8c90a Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Mon, 22 May 2023 09:36:54 +0800 Subject: [PATCH] Complete some go build tags and fix declaration on MacOS Signed-off-by: zhangguanzhang --- jmp_arm64.go | 11 +++++++---- jmp_loong64.go | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jmp_arm64.go b/jmp_arm64.go index add3fd9..772aa0c 100644 --- a/jmp_arm64.go +++ b/jmp_arm64.go @@ -1,3 +1,6 @@ +//go:build arm64 +// +build arm64 + package gomonkey import "unsafe" @@ -9,10 +12,10 @@ func buildJmpDirective(double uintptr) []byte { d4d5 := double >> 32 & 0xFFFF d6d7 := double >> 48 & 0xFFFF - res = append(res, movImm(0B10, 0, d0d1)...) // MOVZ x26, double[16:0] - res = append(res, movImm(0B11, 1, d2d3)...) // MOVK x26, double[32:16] - res = append(res, movImm(0B11, 2, d4d5)...) // MOVK x26, double[48:32] - res = append(res, movImm(0B11, 3, d6d7)...) // MOVK x26, double[64:48] + res = append(res, movImm(0b10, 0, d0d1)...) // MOVZ x26, double[16:0] + res = append(res, movImm(0b11, 1, d2d3)...) // MOVK x26, double[32:16] + res = append(res, movImm(0b11, 2, d4d5)...) // MOVK x26, double[48:32] + res = append(res, movImm(0b11, 3, d6d7)...) // MOVK x26, double[64:48] res = append(res, []byte{0x4A, 0x03, 0x40, 0xF9}...) // LDR x10, [x26] res = append(res, []byte{0x40, 0x01, 0x1F, 0xD6}...) // BR x10 diff --git a/jmp_loong64.go b/jmp_loong64.go index 1b06254..628dc4f 100644 --- a/jmp_loong64.go +++ b/jmp_loong64.go @@ -1,3 +1,6 @@ +//go:build loong64 +// +build loong64 + package gomonkey import "unsafe"