]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.21] cmd/link: don't mangle string symbol names
authorCherry Mui <cherryyz@google.com>
Fri, 18 Aug 2023 15:10:23 +0000 (11:10 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 23 Aug 2023 17:35:53 +0000 (17:35 +0000)
commitbac083a5847a53bb726f65d6e9c2aeb54066bcf0
treeee5af6de51b7d736fc797d692ea49ad3b0b4bc8f
parent70aa116c4afe064254252a33beb82977ae8df087
[release-branch.go1.21] cmd/link: don't mangle string symbol names

String symbol names could contain weird characters as we put the
string literal into the symbol name. So it may appear to need
mangling. However, as string symbols are grouped into a single
"go:string.*" symbol, the individual symbol names actually don't
matter. So don't mangle them.

Also make the mangling code more defensive in case of weird
symbol names.

Updates #62098.
Fixes #62140.

Change-Id: I533012567a9fffab69debda934f426421c7abb04
Reviewed-on: https://go-review.googlesource.com/c/go/+/520856
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit b65e34f03814889f0edd3ddd9778864762511443)
Reviewed-on: https://go-review.googlesource.com/c/go/+/520857
src/cmd/cgo/internal/testplugin/plugin_test.go
src/cmd/cgo/internal/testplugin/testdata/mangle/plugin.go [moved from src/cmd/cgo/internal/testplugin/testdata/generic/plugin.go with 57% similarity]
src/cmd/link/internal/ld/lib.go