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
go tool nm: weird local.$(pkg) symbol #31568
Comments
I don't know. I don't see that in Go binaries that I build. How exactly did you build your binary? Are you sure that nothing imports "local.code.byted.org/..."? Note that you are likely to get better answers on a forum like golang-nuts. See https://golang.org/wiki/Questions. |
It comes from cmd/link/internal/ld/symtab.go:
I still don't know exactly what it means. I think you can ignore it for purposes of binary size, though: the symbol clearly has the same address as the real one. |
Turn out: one of the common lib using plugin. import plugin
_, err := plugin.Open("x.so") a dummy code like this will introduce significant amount of local.* symbols in the final binary, which huge increase the binary size (dep on u binary size). |
demo package main
import (
"fmt"
"plugin"
)
func main() {
_, err := plugin.Open("test.so")
if err != nil {
fmt.Println("tet")
}
} go tool nm ./$(binary) | grep runtime.abort.f |
The duplicate |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
$(mypkg) binary size 364MB.
By using https://github.com/knz/go-binsize-viz, I found:
By using "go tool nm ", I found something like this:
64ce350 2709 t local.code.byted.org/..../game_entry.(*GameEntryRequest).Read
64ce350 2709 T code.byted.org/..../game_entry.(*GameEntryRequest).Read
So the questions is: what's the local.(pkg) symbol ? where is it come from ??
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: