Skip to content
New issue

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

plugin: Open should work with so files from other directories #17634

Closed
rakyll opened this issue Oct 27, 2016 · 2 comments
Closed

plugin: Open should work with so files from other directories #17634

rakyll opened this issue Oct 27, 2016 · 2 comments
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Oct 27, 2016

Given the following setup, Open fails because the plugin package is looking for the symbol a/a.Hello instead of a.Hello. We should strip the path before looking up for the symbols.

tree
.
├── a
│   ├── a.go
│   └── a.so
└── main.go
$ cat main.go
package main

import (
    "log"
    "plugin"
)

func main() {
    p, err := plugin.Open("a/a.so")
    if err != nil {
        log.Fatal(err)
    }
    s, err := p.Lookup("Hello")
    if err != nil {
        log.Fatal(err)
    }
    log.Println(s)
}

$ go run main.go
2016/10/27 09:46:14 plugin.Open: could not find symbol Hello: dlsym(0x4700010, a/a.Hello): symbol not found
exit status 1
@rakyll rakyll added this to the Go1.8 milestone Oct 27, 2016
@rakyll
Copy link
Contributor Author

rakyll commented Oct 27, 2016

Duplicate of #17155.

@rakyll rakyll closed this as completed Oct 27, 2016
@gopherbot
Copy link

CL https://golang.org/cl/32232 mentions this issue.

@golang golang locked and limited conversation to collaborators Oct 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants