summaryrefslogtreecommitdiff
path: root/libgo/go/reflect
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/reflect')
-rw-r--r--libgo/go/reflect/makefunc_ffi.go11
-rw-r--r--libgo/go/reflect/makefunc_ffi_c.c6
2 files changed, 9 insertions, 8 deletions
diff --git a/libgo/go/reflect/makefunc_ffi.go b/libgo/go/reflect/makefunc_ffi.go
index 4564736bc99..88ffca56ca0 100644
--- a/libgo/go/reflect/makefunc_ffi.go
+++ b/libgo/go/reflect/makefunc_ffi.go
@@ -15,19 +15,20 @@ func makeFuncFFI(cif unsafe.Pointer, impl unsafe.Pointer)
// The makeCIF function, implemented in the runtime package, allocates a CIF.
func makeCIF(ft *funcType) unsafe.Pointer
-// FFICallbackGo implements the Go side of the libffi callback.
-// It is exported so that C code can call it.
+// Export ffiCallbackGo so that C code in makefunc_ffi_c.c can call it.
+//go:linkname ffiCallbackGo
+
+// ffiCallbackGo implements the Go side of the libffi callback.
//
// The call chain arriving here looks like
// some_go_caller
// ->some_ffi_internals
// ->ffi_callback (in C)
-// ->FFICallbackGo
+// ->ffiCallbackGo
//
// The ffi_callback handles __go_makefunc_can_recover, and
// then passes off the data as received from ffi here.
-
-func FFICallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFuncImpl) {
+func ffiCallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFuncImpl) {
ftyp := impl.typ
in := make([]Value, 0, len(ftyp.in))
ap := params
diff --git a/libgo/go/reflect/makefunc_ffi_c.c b/libgo/go/reflect/makefunc_ffi_c.c
index a0cfb38890e..e57bd512e87 100644
--- a/libgo/go/reflect/makefunc_ffi_c.c
+++ b/libgo/go/reflect/makefunc_ffi_c.c
@@ -25,8 +25,8 @@ void makeFuncFFI(void *cif, void *impl)
function ffiCall with the pointer to the arguments, the results area,
and the closure structure. */
-extern void FFICallbackGo(void *result, void **args, ffi_go_closure *closure)
- __asm__ (GOSYM_PREFIX "reflect.FFICallbackGo");
+extern void ffiCallbackGo(void *result, void **args, ffi_go_closure *closure)
+ __asm__ (GOSYM_PREFIX "reflect.ffiCallbackGo");
extern void makefuncfficanrecover(Slice)
__asm__ (GOSYM_PREFIX "runtime.makefuncfficanrecover");
@@ -72,7 +72,7 @@ ffi_callback (ffi_cif* cif __attribute__ ((unused)), void *results,
makefuncfficanrecover (s);
}
- FFICallbackGo(results, args, closure);
+ ffiCallbackGo(results, args, closure);
if (i < n)
makefuncreturning ();