]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.16] cmd/compile, cmd/link: dynamically export writable static...
authorCherry Zhang <cherryyz@google.com>
Sat, 13 Mar 2021 04:21:09 +0000 (23:21 -0500)
committerAlexander Rakoczy <alex@golang.org>
Thu, 25 Mar 2021 18:33:03 +0000 (18:33 +0000)
commitac59d7abb9ab5ec31cb0fe1eaccbdf3b17edbde0
tree79ded1fa3e28b9c65b5512f2ed091ab6fcb56363
parent33fb47921f65d941b232da2ab542191c9978b4dc
[release-branch.go1.16] 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.)

Updates #44956.
Fixes #45030.

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>
(cherry picked from commit de012bc095359e1b552d4ea6fb6b2995f3ab04f5)
Reviewed-on: https://go-review.googlesource.com/c/go/+/302449
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/gc/sinit.go
src/cmd/link/internal/ld/symtab.go