-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabi.go
39 lines (33 loc) · 1.31 KB
/
abi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2021 The Go Darwin Authors
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && amd64 && gc
// +build darwin,amd64,gc
package sys
import (
_ "unsafe" // for go:linkname
)
// FuncPC* intrinsics.
//
// CAREFUL: In programs with plugins, FuncPC* can return different values
// for the same function (because there are actually multiple copies of
// the same function in the address space). To be safe, don't use the
// results of this function in any == expression. It is only safe to
// use the result as an address at which to start executing code.
// FuncPCABI0 returns the entry PC of the function f, which must be a
// direct reference of a function defined as ABI0. Otherwise it is a
// compile-time error.
//
// Implemented as a compile intrinsic.
//
//go:linkname FuncPCABI0 internal/abi.FuncPCABI0
func FuncPCABI0(f interface{}) uintptr
// FuncPCABIInternal returns the entry PC of the function f. If f is a
// direct reference of a function, it must be defined as ABIInternal.
// Otherwise it is a compile-time error. If f is not a direct reference
// of a defined function, it assumes that f is a func value. Otherwise
// the behavior is undefined.
//
// Implemented as a compile intrinsic.
//
//go:linkname FuncPCABIInternal internal/abi.FuncPCABIInternal
func FuncPCABIInternal(f interface{}) uintptr