]> Cypherpunks repositories - gostls13.git/commit
cmd, runtime: fix C trampolines on aix/ppc64
authorClément Chigot <clement.chigot@atos.net>
Wed, 20 Feb 2019 15:52:35 +0000 (16:52 +0100)
committerIan Lance Taylor <iant@golang.org>
Tue, 19 Mar 2019 03:18:05 +0000 (03:18 +0000)
commit0cd74d1f1181c113352476d2913141e7cc88abc2
tree8744f99db8f6d21748b1930cfc23d5344c92a57e
parentca36af215f78b670000b31e7573f0fcf0c5de594
cmd, runtime: fix C trampolines on aix/ppc64

C trampolines are made by fixup CSECTS which are added between two
symbols. If such CSECTS is added inside Go functions, all method
offsets stored in moduledatas will be wrong.
In order to prevent this, every C code is moved at the end of the
executable and long calls are created for GO functions called by C
code.
The main function can't longer be made in Go as AIX __start isn't using
a long call to branch on it. Therefore, a main is defined on
runtime/cgo.

Change-Id: I214b18decdb83107cf7325b298609eef9f9d1330
Reviewed-on: https://go-review.googlesource.com/c/go/+/164010
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/work/exec.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/pcln.go
src/cmd/link/internal/ld/xcoff.go
src/runtime/asm_ppc64x.s
src/runtime/cgo/callbacks_aix.go [new file with mode: 0644]
src/runtime/cgo/gcc_aix_ppc64.S
src/runtime/cgo/gcc_aix_ppc64.c [new file with mode: 0644]