]> Cypherpunks repositories - gostls13.git/commit
cmd/compile, cmd/link: dynamically export writable static tmps
authorCherry Zhang <cherryyz@google.com>
Sat, 13 Mar 2021 04:21:09 +0000 (23:21 -0500)
committerCherry Zhang <cherryyz@google.com>
Tue, 16 Mar 2021 23:14:54 +0000 (23:14 +0000)
commit7a1e963058460d4136603b86386f2bae6fe0d5f2
tree2f1616a4213dfbb436135d4389e63d621f581b41
parentdc1556eaef871074895ed9fdf6028475d53235be
cmd/compile, cmd/link: dynamically export writable static tmps

Static tmps are private to a package, but with plugins a package
can be shared among multiple DSOs. They need to have a consistent
view of the static tmps, especially for writable ones. So export
them. (Read-only static tmps have the same values anyway, so it
doesn't matter. Also Mach-O doesn't support dynamically exporting
read-only symbols anyway.)

Fixes #44956.

Change-Id: I921e25b7ab73cd5d5347800eccdb7931e3448779
Reviewed-on: https://go-review.googlesource.com/c/go/+/301793
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
misc/cgo/testplugin/plugin_test.go
misc/cgo/testplugin/testdata/issue44956/base/base.go [new file with mode: 0644]
misc/cgo/testplugin/testdata/issue44956/main.go [new file with mode: 0644]
misc/cgo/testplugin/testdata/issue44956/plugin1.go [new file with mode: 0644]
misc/cgo/testplugin/testdata/issue44956/plugin2.go [new file with mode: 0644]
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/walk/complit.go
src/cmd/link/internal/ld/symtab.go