]> Cypherpunks repositories - gostls13.git/commit
cmd/link, plugin: use full plugin path for symbols
authorDavid Crawshaw <crawshaw@golang.org>
Sun, 30 Oct 2016 19:31:21 +0000 (15:31 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Mon, 31 Oct 2016 04:48:42 +0000 (04:48 +0000)
commit9da7058466c8c9f32e1481f28d57732832ee3b30
tree4efee9a2f4753fe894765b9f2409b23c4fdfe4fb
parent590fce48849cc7f81b890d6e9b6120fc6681e19a
cmd/link, plugin: use full plugin path for symbols

Plumb the import path of a plugin package through to the linker, and
use it as the prefix on the exported symbol names.

Before this we used the basename of the plugin file as the prefix,
which could conflict and result in multiple loaded plugins sharing
symbols that are distinct.

Fixes #17155
Fixes #17579

Change-Id: I7ce966ca82d04e8507c0bcb8ea4ad946809b1ef5
Reviewed-on: https://go-review.googlesource.com/32355
Reviewed-by: Ian Lance Taylor <iant@golang.org>
12 files changed:
misc/cgo/testplugin/src/host/host.go
misc/cgo/testplugin/src/plugin1/plugin1.go
misc/cgo/testplugin/src/sub/plugin1/plugin1.go [new file with mode: 0644]
misc/cgo/testplugin/test.bash
src/cmd/go/build.go
src/cmd/link/doc.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/symtab.go
src/plugin/plugin.go
src/plugin/plugin_dlopen.go
src/runtime/plugin.go
src/runtime/symtab.go