diff options
| author | Cherry Mui <cherryyz@google.com> | 2023-03-31 19:56:26 +0000 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2023-04-03 18:58:39 +0000 |
| commit | 4ac638f4b7c49370a62db4e6232f2895d7bbda0d (patch) | |
| tree | 82a58296be851fe71b6ee2d1379acbc1e3373b94 /src/runtime/cgo | |
| parent | f46320849da89bea3e23bae985ad753d30bbc5da (diff) | |
| download | go-4ac638f4b7c49370a62db4e6232f2895d7bbda0d.tar.xz | |
Revert "Revert "runtime: consolidate function descriptor definitions on PPC64""
This reverts CL 481059, which in turn reverts CL 478917.
Reason for revert: reapply the original CL.
Change-Id: Icf6bb6a620313b44fadcc7f69a62fdbb943e34fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/481075
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Diffstat (limited to 'src/runtime/cgo')
| -rw-r--r-- | src/runtime/cgo/asm_ppc64x.s | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/runtime/cgo/asm_ppc64x.s b/src/runtime/cgo/asm_ppc64x.s index 8eb4a42157..7752feb650 100644 --- a/src/runtime/cgo/asm_ppc64x.s +++ b/src/runtime/cgo/asm_ppc64x.s @@ -7,26 +7,25 @@ #include "textflag.h" #include "asm_ppc64x.h" +#ifdef GO_PPC64X_HAS_FUNCDESC +// crosscall2 is marked with go:cgo_export_static. On AIX, this creates and exports +// the symbol name and descriptor as the AIX linker expects, but does not work if +// referenced from within Go. Create and use an aliased descriptor of crosscall2 +// to workaround this. +DEFINE_PPC64X_FUNCDESC(_crosscall2<>, crosscall2) +#define CROSSCALL2_FPTR $_crosscall2<>(SB) +#else +#define CROSSCALL2_FPTR $crosscall2(SB) +#endif + // Set the x_crosscall2_ptr C function pointer variable point to crosscall2. // It's such a pointer chain: _crosscall2_ptr -> x_crosscall2_ptr -> crosscall2 TEXT ·set_crosscall2(SB),NOSPLIT,$0-0 MOVD _crosscall2_ptr(SB), R5 -#ifdef GOARCH_ppc64 - MOVD $_crosscall2<>(SB), R6 -#else - MOVD $crosscall2(SB), R6 -#endif + MOVD CROSSCALL2_FPTR, R6 MOVD R6, (R5) RET -#ifdef GO_PPC64X_HAS_FUNCDESC -// _crosscall2<> is a function descriptor to the real crosscall2. -DATA _crosscall2<>+0(SB)/8, $crosscall2(SB) -DATA _crosscall2<>+8(SB)/8, $TOC(SB) -DATA _crosscall2<>+16(SB)/8, $0 -GLOBL _crosscall2<>(SB), NOPTR, $24 -#endif - // Called by C code generated by cmd/cgo. // func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr) // Saves C callee-saved registers and calls cgocallback with three arguments. |
