commit | 556e9c36baad127ec34be5d2f7e29ae5fd594dcf | [log] [tgz] |
---|---|---|
author | Than McIntosh <thanm@google.com> | Wed Sep 06 10:15:37 2023 -0400 |
committer | Than McIntosh <thanm@google.com> | Wed Sep 20 16:24:52 2023 +0000 |
tree | 9797b300d07dd355c15ca048536858a4bec49a2a | |
parent | b64dc5f499400f1ec3ef0192cc2d42a87a1916a8 [diff] |
[release-branch.go1.21] cmd/link: avoid deadcode of global map vars for programs using plugins If a program imports the plugin package, the mechanisms in place for detecting and deleting unused global map variables are no longer safe, since it's possibly for a given global map var to be unreferenced in the main program but referenced by a plugin. This patch changes the linker to test for plugin use and to avoid removing any unused global map variables if the main program could possibly load up a plugin. Fixes #62505. Updates #62430. Change-Id: Ie00b18b681cb0d259e3c859ac947ade5778cd6c8 (cherry picked from commit 660620dd45dc11f2d889add79bedf2dc771c7d04) Reviewed-on: https://go-review.googlesource.com/c/go/+/526575 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.