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/ld: symbols missing first letter of package name #8906

Closed
cookieo9 opened this issue Oct 7, 2014 · 7 comments
Closed

cmd/ld: symbols missing first letter of package name #8906

cookieo9 opened this issue Oct 7, 2014 · 7 comments
Milestone

Comments

@cookieo9
Copy link
Contributor

cookieo9 commented Oct 7, 2014

When running "go tool nm" on a compiled binary, many symbols are shown that
are missing the first character. For example, there are a bunch of "untime"
symbols present, and show up at the end of the list.

This issue is present elsewhere shown by other tools. The system's "nm" tool
shows the same symbols with equally broken names, and when profiling, it makes it
annoying to isolate a package using regexps because instead of "weblist main",
to see all my main package functions, I have to "weblist ain".

I'm not sure of an exact procedure to cause this issue, as functions in both
"untime" and "runtime" can exist in the binary at once, but it seems
to happen a lot to anonymous functions.

For example: http://play.golang.org/p/73KeNq5BM1 , all the anonymous functions are
"ain.func.*" while the main function is "main.main".

Tested at tip on darwin/amd64 as well as in the hombrew version of go1.3.3 .
@ianlancetaylor
Copy link
Member

Comment 1:

Can anybody else replicate this problem?  I wasn't able to, but I didn't try on a Darwin
system.

Labels changed: added repo-main, release-go1.4maybe.

@mikioh
Copy link
Contributor

mikioh commented Oct 8, 2014

Comment 2:

it happens on darwin certainly, see attached which is the output of nm -m.
% clang --version
Apple LLVM version 6.0 (clang-600.0.47) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Attachments:

  1. nm.txt (66361 bytes)

@minux
Copy link
Member

minux commented Oct 10, 2014

Comment 3:

I compiled today's tip, and verified that gofmt contains these symbols:
00000000001e6540 s untime.GoroutineProfile.f
00000000001e6548 s untime.ThreadCreateProfile.f
00000000001e6568 s untime.aeshash.f
00000000001e6550 s untime.aeshash32.f
....
00000000001e67c8 s ync.(*Mutex).Unlock.f
00000000001e67d0 s ync.(*RWMutex).RUnlock.f
00000000001e67d8 s ync.(*RWMutex).Unlock.f
000000000010e9b0 t ync.init.1
000000000010e9e0 t ync.init.2
Seems there is an off-by-one error somewhere (interestingly, all of
them are aux symbols created by the compiler.)
New regression introduced in 1.4, mark as blocking the release.

Labels changed: added release-go1.4, os-macosx, removed release-go1.4maybe.

Status changed to Accepted.

@minux
Copy link
Member

minux commented Oct 10, 2014

Comment 4:

It's my fault. https://golang.org/cl/72280043/diff/220001/src/cmd/ld/macho.c

Owner changed to @minux.

@minux
Copy link
Member

minux commented Oct 10, 2014

Comment 5:

Update: it's not regression of 1.4, 1.3.x is also affected.

@gopherbot
Copy link
Contributor

Comment 6:

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

@minux
Copy link
Member

minux commented Oct 11, 2014

Comment 8:

This issue was closed by revision 8fe5ef4.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
I diffed the output of `nm -n gofmt' before and after this change,
and verified that all changes are correct and all corrupted symbol
names are fixed.

Fixes golang#8906.

LGTM=iant, cookieo9
R=golang-codereviews, iant, cookieo9
CC=golang-codereviews
https://golang.org/cl/159750043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
I diffed the output of `nm -n gofmt' before and after this change,
and verified that all changes are correct and all corrupted symbol
names are fixed.

Fixes golang#8906.

LGTM=iant, cookieo9
R=golang-codereviews, iant, cookieo9
CC=golang-codereviews
https://golang.org/cl/159750043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
I diffed the output of `nm -n gofmt' before and after this change,
and verified that all changes are correct and all corrupted symbol
names are fixed.

Fixes golang#8906.

LGTM=iant, cookieo9
R=golang-codereviews, iant, cookieo9
CC=golang-codereviews
https://golang.org/cl/159750043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
I diffed the output of `nm -n gofmt' before and after this change,
and verified that all changes are correct and all corrupted symbol
names are fixed.

Fixes golang#8906.

LGTM=iant, cookieo9
R=golang-codereviews, iant, cookieo9
CC=golang-codereviews
https://golang.org/cl/159750043
This issue was closed.
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

6 participants