go/src/runtime/cgo
Lynn Boger bade680867 runtime/cgo: fix crosscall2 on ppc64x
Some uses of crosscall2 did not work on ppc64le and probably
aix-ppc64. In particular, if there was a main program compiled
with -buildmode=pie and used a plugin which invoked crosscall2,
then failures could occur due to R2 getting set incorrectly along the
way. The problem was due to R2 being saved on the caller's
stack; it is now saved on the crosscall2 stack. More details can be
found in the issue.

This adds a testcase where the main program is built with pie
and the plugin invokes crosscall2.

This also changes the save of the CR bits from MOVD to MOVW as
it should be.

Fixes #43228

Change-Id: Ib5673e25a2ec5ee46bf9a1ffb0cb1f3ef5449086
Reviewed-on: https://go-review.googlesource.com/c/go/+/319489
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Heschi Kreinick <heschi@google.com>
2021-05-17 15:57:52 +00:00
..
abi_amd64.h runtime: unify C->Go ABI transitions 2021-04-15 12:38:13 +00:00
asm_386.s
asm_amd64.s runtime: unify C->Go ABI transitions 2021-04-15 12:38:13 +00:00
asm_arm.s
asm_arm64.s
asm_mips64x.s all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00
asm_mipsx.s all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00
asm_ppc64x.s runtime/cgo: fix crosscall2 on ppc64x 2021-05-17 15:57:52 +00:00
asm_riscv64.s all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00
asm_s390x.s
asm_wasm.s
callbacks.go
callbacks_aix.go
callbacks_traceback.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
cgo.go
dragonfly.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
freebsd.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
gcc_386.S
gcc_aix_ppc64.S
gcc_aix_ppc64.c
gcc_amd64.S [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_android.c
gcc_arm.S
gcc_arm64.S
gcc_context.c
gcc_darwin_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_darwin_arm64.c
gcc_dragonfly_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_fatalf.c
gcc_freebsd_386.c
gcc_freebsd_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_freebsd_arm.c
gcc_freebsd_arm64.c
gcc_freebsd_sigaction.c
gcc_libinit.c
gcc_libinit_windows.c runtime/cgo: use correct lean and mean macro 2021-02-23 15:04:12 +00:00
gcc_linux_386.c runtime/cgo: fix Android build with NDK 22 2020-12-26 19:08:56 +00:00
gcc_linux_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_linux_arm.c runtime/cgo: fix Android build with NDK 22 2020-12-26 19:08:56 +00:00
gcc_linux_arm64.c runtime/cgo: fix Android build with NDK 22 2020-12-26 19:08:56 +00:00
gcc_linux_mips64x.c
gcc_linux_mipsx.c
gcc_linux_ppc64x.S
gcc_linux_riscv64.c cmd/dist,cmd/go,runtime: add support for cgo on linux/riscv64 2020-11-03 12:59:51 +00:00
gcc_linux_s390x.c
gcc_mips64x.S
gcc_mipsx.S
gcc_mmap.c runtime/cgo,cmd/internal/obj/ppc64: fix signals with cgo 2021-05-10 17:21:32 +00:00
gcc_netbsd_386.c
gcc_netbsd_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_netbsd_arm.c
gcc_netbsd_arm64.c
gcc_openbsd_386.c
gcc_openbsd_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_openbsd_arm.c
gcc_openbsd_arm64.c
gcc_openbsd_mips64.c cmd/dist,runtime: support cgo on openbsd/mips64 2021-04-28 12:51:42 +00:00
gcc_ppc64x.c
gcc_riscv64.S cmd/dist,cmd/go,runtime: add support for cgo on linux/riscv64 2020-11-03 12:59:51 +00:00
gcc_s390x.S
gcc_setenv.c
gcc_sigaction.c runtime/cgo,cmd/internal/obj/ppc64: fix signals with cgo 2021-05-10 17:21:32 +00:00
gcc_signal2_ios_arm64.c
gcc_signal_ios_arm64.c
gcc_signal_ios_nolldb.c
gcc_solaris_amd64.c [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
gcc_traceback.c
gcc_util.c
gcc_windows_386.c cmd/link: avoid exporting all symbols on windows buildmode=pie 2020-11-02 00:46:44 +00:00
gcc_windows_amd64.c runtime/cgo: use correct lean and mean macro 2021-02-23 15:04:12 +00:00
gcc_windows_arm64.c runtime: add windows/arm64 cgo-linking code 2021-04-23 21:43:07 +00:00
handle.go runtime/cgo: clarify Handle documentation 2021-04-08 20:24:09 +00:00
handle_test.go runtime/cgo: add Handle for managing (c)go pointers 2021-04-06 23:39:42 +00:00
iscgo.go
libcgo.h [dev.regabi] runtime/cgo: call setg_gcc in crosscall_amd64 2021-02-05 16:09:50 +00:00
libcgo_unix.h
libcgo_windows.h cmd/link: avoid exporting all symbols on windows buildmode=pie 2020-11-02 00:46:44 +00:00
linux.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
linux_syscall.c runtime/cgo: add cast in C code to avoid C compiler warning 2021-02-18 02:48:11 +00:00
mmap.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
netbsd.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
openbsd.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
setenv.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
sigaction.go runtime/cgo,cmd/internal/obj/ppc64: fix signals with cgo 2021-05-10 17:21:32 +00:00
signal_ios_arm64.go
signal_ios_arm64.s