1 // Copyright 2022 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Issue 53989: the use of jump table caused a function
6 // from the plugin jumps in the middle of the function
7 // to the function with the same name in the main
8 // executable. As these two functions may be compiled
9 // differently as plugin needs to be PIC, this causes
17 "testplugin/issue53989/p"
21 p.Square(7) // call the function in main executable
23 p, err := plugin.Open("issue53989.so")
27 f, err := p.Lookup("Square")
31 f.(func(int))(7) // call the plugin one