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

Comments

Projects
None yet
5 participants
@grantseltzer
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

commented Sep 22, 2018

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

@bcmills bcmills added this to the Unplanned milestone Sep 22, 2018

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2018

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

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2018

@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

This comment has been minimized.

Copy link

commented Oct 16, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented Oct 16, 2018

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

@gopherbot gopherbot closed this in ffbf479 Oct 22, 2018

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.