The hash is a SHA1 of the package object data, generated by the linker, cmd/link. The hash is created in the function genhash, and placed in the moduledata in the symtab method.
Using a hash of the object data means a plugin has to be compiled against exactly the same package as the host binary. On Wed, Dec 14, 2016 at 1:54 PM, Ian Lance Taylor <i...@golang.org> wrote: > [ +crawshaw ] > > On Wed, Dec 14, 2016 at 9:03 AM, David Norton <dgnor...@gmail.com> wrote: >> I'm trying to better understand how the runtime checks package versions when >> using the plugin pkg. If there's a mismatch, the following error occurs at >> run time: >> >>> plugin.Open: plugin was built with a different version of package ... >> >> >> That message originates, in the runtime, here. Where does runtimehash get >> set? Maybe someone could give a brief explanation of how version checking >> works when using the new plugin pkg? >> >> Thanks, >> David >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.