Choosing ABI for a function

87 views
Skip to first unread message

Aviram Hassan

unread,
Nov 8, 2022, 3:55:14 PM11/8/22
to golang-nuts
Hi,
I see that some runtime functions have both `abi0` interface and `ABIInternal`.
I was wondering what makes the compiler do so, and if I can make it do the same for my defined functions?
A bit of a background - I'm doing a bit of a lowlevel fun, and I want to hook Go functions using just Go code (no assembly) so I want to have the same interface as the original ones.

Thanks!

Ian Lance Taylor

unread,
Nov 8, 2022, 5:15:06 PM11/8/22
to Aviram Hassan, golang-nuts

Aviram Hassan

unread,
Nov 9, 2022, 5:15:46 PM11/9/22
to Ian Lance Taylor, golang-nuts
Thank you.
I found that the best way (or only?) is to have an assembly function reference a Go function, then the compiler creates a wrapper that can be used.
Reply all
Reply to author
Forward
0 new messages