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/link: executable contains the full path of GOROOT (even with -ldflags -w) #12770

Closed
typeless opened this issue Sep 28, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@typeless
Copy link

commented Sep 28, 2015

$ uname -a
Darwin users-MacBook-Air.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
$ go version
go version devel +c468957 Sun Sep 27 01:04:59 2015 +0000 darwin/amd64

# The only thing the program does is fmt.Print("Hello\n")
$ cd hello
$ go build -ldflags -w
$ hexdump -C hello | grep -c `basename $HOME`
58

@adg adg changed the title Compiled executable contains the full path of home directory (even with -ldflags -w) cmd/link: executable contains the full path of GOROOT (even with -ldflags -w) Sep 28, 2015

@adg

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2015

It's the GOROOT (the path to your Go install), which just happens to be in $HOME on your system.

@typeless

This comment has been minimized.

Copy link
Author

commented Sep 28, 2015

Looks like these path strings reside in __TEXT __gopclntab

$ otool -sv __TEXT __gopclntab hello
@minux

This comment has been minimized.

Copy link
Member

commented Sep 28, 2015

@minux

This comment has been minimized.

Copy link
Member

commented Sep 28, 2015

@rakyll

This comment has been minimized.

Copy link
Member

commented Sep 28, 2015

Duplicate of #3467.

@rakyll rakyll closed this Sep 28, 2015

@golang golang locked and limited conversation to collaborators Sep 27, 2016

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