diff options
| author | Cherry Mui <cherryyz@google.com> | 2023-08-18 11:10:23 -0400 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2023-08-18 15:53:47 +0000 |
| commit | b65e34f03814889f0edd3ddd9778864762511443 (patch) | |
| tree | 3d7ad001b1fb162effb8a716931d0909750233e8 /src/cmd/cgo/internal/testplugin/plugin_test.go | |
| parent | d63c88d6959f2081bcaf4026306ca8878e8f335a (diff) | |
| download | go-b65e34f03814889f0edd3ddd9778864762511443.tar.xz | |
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.
Fixes #62098.
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>
Diffstat (limited to 'src/cmd/cgo/internal/testplugin/plugin_test.go')
| -rw-r--r-- | src/cmd/cgo/internal/testplugin/plugin_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/cgo/internal/testplugin/plugin_test.go b/src/cmd/cgo/internal/testplugin/plugin_test.go index 22fa35512b..2950b6c970 100644 --- a/src/cmd/cgo/internal/testplugin/plugin_test.go +++ b/src/cmd/cgo/internal/testplugin/plugin_test.go @@ -380,9 +380,11 @@ func TestForkExec(t *testing.T) { } } -func TestGeneric(t *testing.T) { +func TestSymbolNameMangle(t *testing.T) { // Issue 58800: generic function name may contain weird characters // that confuse the external linker. + // Issue 62098: the name mangling code doesn't handle some string + // symbols correctly. globalSkip(t) - goCmd(t, "build", "-buildmode=plugin", "-o", "generic.so", "./generic/plugin.go") + goCmd(t, "build", "-buildmode=plugin", "-o", "mangle.so", "./mangle/plugin.go") } |
