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

cmd/go: go version <binary> fails with -buildmode=pie Linux ELF binaries #31861

Open
rsc opened this issue May 6, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@rsc
Copy link
Contributor

commented May 6, 2019

$ go build -o /tmp/go.exe
$ go version /tmp/go.exe
/tmp/go.exe: go version not found
$

It's possible I am using too old a tree but I think this is still broken at head.

@rsc rsc added this to the Go1.13 milestone May 6, 2019

@rsc rsc added the release-blocker label May 6, 2019

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 6, 2019

In a -buildmode=pie executable the .go.buildinfo section is deep into the data segment, much farther than the 64K that go version reads. This doesn't actually have anything to do with -buildmode=pie as such; go version fails on ELF systems when using -ldflags=-linkmode=external, and -buildmode=pie currently implies an external link.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented May 6, 2019

It's not clear to me why the .go.buildinfo section is writable.

@dotaheor

This comment has been minimized.

Copy link

commented May 7, 2019

A little off topic, is there an option to disable packaging module versions in building?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.