We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
golang so can't export function call crash, please support
The text was updated successfully, but these errors were encountered:
i think tooBugs means that exported go .so files aren't supported by the loader, for example the code
package main import ( "C" "fmt" ) //export Runme func Runme() string { return "hello world, bipbop!" } func main() { fmt.Println(Runme()) }
built with
go build -o libplugin.so -buildmode=c-shared plugin.go
and loaded with
package main import ( "fmt" "io/ioutil" "github.com/Binject/universal" ) func main() { libraryPath := "libplugin.so" image, err := ioutil.ReadFile(libraryPath) if err != nil { panic(err) } loader, err := universal.NewLoader() if err != nil { panic(err) } library, err := loader.LoadLibrary("main", &image) if err != nil { panic(err) } // fmt.Println("call") // runmeProc, ok := library.FindProc("Runme") // if !ok { // fmt.Println("FindProc did not find export Runme") // return // } val, err := library.Call("Runme") if err != nil { panic(err) } fmt.Println(val) }
does not work, at least, for me, on linux amd64, if possible please help!
Sorry, something went wrong.
yes ,this project only support C so, golang runtime can't load second time, another project can support this。i think this can help you !https://github.com/pkujhd/goloader
No branches or pull requests
golang so can't export function call crash, please support
The text was updated successfully, but these errors were encountered: