From 9da7058466c8c9f32e1481f28d57732832ee3b30 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Sun, 30 Oct 2016 15:31:21 -0400 Subject: 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 --- src/plugin/plugin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugin/plugin.go') diff --git a/src/plugin/plugin.go b/src/plugin/plugin.go index 93ae23f3f1..e812a2f677 100644 --- a/src/plugin/plugin.go +++ b/src/plugin/plugin.go @@ -18,9 +18,9 @@ package plugin // Plugin is a loaded Go plugin. type Plugin struct { - name string - loaded chan struct{} // closed when loaded - syms map[string]interface{} + pluginpath string + loaded chan struct{} // closed when loaded + syms map[string]interface{} } // Open opens a Go plugin. -- cgit v1.3