diff options
Diffstat (limited to 'src/runtime/plugin.go')
| -rw-r--r-- | src/runtime/plugin.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/runtime/plugin.go b/src/runtime/plugin.go index 7907936e14..845bf76e92 100644 --- a/src/runtime/plugin.go +++ b/src/runtime/plugin.go @@ -7,7 +7,7 @@ package runtime import "unsafe" //go:linkname plugin_lastmoduleinit plugin.lastmoduleinit -func plugin_lastmoduleinit() (path string, syms map[string]interface{}) { +func plugin_lastmoduleinit() (path string, syms map[string]interface{}, mismatchpkg string) { md := firstmoduledata.next if md == nil { throw("runtime: no plugin module data") @@ -41,6 +41,11 @@ func plugin_lastmoduleinit() (path string, syms map[string]interface{}) { throw("plugin: new module data overlaps with previous moduledata") } } + for _, pkghash := range md.pkghashes { + if pkghash.linktimehash != *pkghash.runtimehash { + return "", nil, pkghash.modulename + } + } // Initialize the freshly loaded module. modulesinit() @@ -74,7 +79,7 @@ func plugin_lastmoduleinit() (path string, syms map[string]interface{}) { } syms[name] = val } - return md.pluginpath, syms + return md.pluginpath, syms, "" } // inRange reports whether v0 or v1 are in the range [r0, r1]. |
