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: temporary empty symbols are being stored in the ELF symbol table #27800

Closed
grantseltzer opened this issue Sep 21, 2018 · 5 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@grantseltzer
Copy link
Contributor

grantseltzer commented Sep 21, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10.3 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/grant/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/grant/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build731681085=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I was doing disassembly related research and noticed that there's a whole bunch of empty symbols in the symbol table that seem to have been for temporary purposes. Things like: unicode.statictmp_103

gist of the go program and its output

What did you expect to see?

No temporary empty symbols being part of the compiled ELF symbol table

What did you see instead?

Temporary empty symbols being part of the compiled ELF symbol table

@odeke-em odeke-em changed the title Empty symbols are being stored in the ELF symbol table cmd/link: empty symbols are being stored in the ELF symbol table Sep 22, 2018
@odeke-em odeke-em added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 22, 2018
@odeke-em
Copy link
Member

Kindly paging some linker folks @ianlancetaylor @heschik @thanm @aclements

@bcmills bcmills added this to the Unplanned milestone Sep 22, 2018
@cherrymui
Copy link
Member

What's the problem with 0-sized symbols? For a C program compiled with GCC, there are also a bunch of 0-sized symbols.

@grantseltzer grantseltzer changed the title cmd/link: empty symbols are being stored in the ELF symbol table cmd/link: temporary empty symbols are being stored in the ELF symbol table Sep 23, 2018
@grantseltzer
Copy link
Contributor Author

@cherrymui 0-sized symbols isn't the issue, it's the temporary ones such as:

{Name:unicode.statictmp_111 Info:17 Other:0 Section:SHN_UNDEF+11 Value:5623968 Size:0}

I wasn't clear about that in the issue title/description. Updated.

@gopherbot
Copy link

Change https://golang.org/cl/142497 mentions this issue: cmd/compile,cmd/link: avoid collisions between statictmps and user vars

@gopherbot
Copy link

Change https://golang.org/cl/142577 mentions this issue: cmd/compile,cmd/link: remove statictmp variables from symbol table.

@golang golang locked and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants