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
Closed

Comments

@typeless
Copy link

$ 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
Copy link
Contributor

adg 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
Copy link
Author

Looks like these path strings reside in __TEXT __gopclntab

$ otool -sv __TEXT __gopclntab hello

@minux
Copy link
Member

minux commented Sep 28, 2015 via email

@minux
Copy link
Member

minux commented Sep 28, 2015 via email

@rakyll
Copy link
Contributor

rakyll commented Sep 28, 2015

Duplicate of #3467.

@rakyll rakyll closed this as completed 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.
Projects
None yet
Development

No branches or pull requests

5 participants