runtime, cmd/link: add hall of shame linknames for some cgo symbols
cgocallback, load_g, and crosscall2 should be an internal detail, but they are accessed in github.com/ebitengine/purego via assembly code. For compatibility, add hall-of-shame export linknames. crosscall2 is more involved, in that it is meant to be called from C code, therefore has cgo_export pragmas. The compiler (correctly) does not allow ABI wrappers to cgo_export symbols as they should follow C ABI, not Go ABI. We cannot simply add a linkname declaration, which would would make it looks like it will be called from Go code therefore triggers ABI wrapper generation. Instead, we permit it in the linker. In fact, permit all symbols without "." in the name, as they are meant to be called externally. Fixes #79702. Change-Id: Ia5c66eea7669bf855f5898bb3cf45acce5723e65 Reviewed-on: https://go-review.googlesource.com/c/go/+/784200 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
C
Cherry Mui committed
594517bf2bbf5c878b9d3ac68b782166943e5cd8
Parent: 66b64c1