|
|
@@ -13,6 +13,7 @@ import (
|
|
|
|
|
|
"github.com/cilium/ebpf/link"
|
|
|
"golang.org/x/arch/x86/x86asm"
|
|
|
+ "golang.org/x/arch/arm64/arm64asm"
|
|
|
)
|
|
|
|
|
|
const (
|
|
|
@@ -179,6 +180,20 @@ func getCallNextMoveOffsets(machine elf.Machine, instructions []byte) []int {
|
|
|
}
|
|
|
i += ins.Len
|
|
|
}
|
|
|
+ case elf.EM_AARCH64:
|
|
|
+ for i := 0; i < len(instructions); {
|
|
|
+ ins, err := arm64asm.Decode(instructions[i:])
|
|
|
+ if err == nil && ins.Op == arm64asm.BL {
|
|
|
+ if firstCall == 0{
|
|
|
+ firstCall = 1
|
|
|
+ }else{
|
|
|
+ i += 4
|
|
|
+ res = append(res, i)
|
|
|
+ return res
|
|
|
+ }
|
|
|
+ }
|
|
|
+ i += 4
|
|
|
+ }
|
|
|
}
|
|
|
return res
|
|
|
}
|