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: race enabled binaries are too large #9359
Comments
Fix is easy:
Candidate for 1.4.1? |
Turns out this bug is present ever since Go supports loading ELF files. Anyway, I believe this still is a 1.4 regression without any meaningful |
That would explain why the release
|
mailed https://golang.org/cl/1889 |
…al .bss section Fixes #9359. Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/1889 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 1c0c611) Reviewed-on: https://go-review.googlesource.com/2802 Reviewed-by: Andrew Gerrand <adg@golang.org>
…al .bss section Fixes golang#9359. Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/1889 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 1c0c611) Reviewed-on: https://go-review.googlesource.com/2802 Reviewed-by: Andrew Gerrand <adg@golang.org>
…al .bss section Fixes golang#9359. Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/1889 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 1c0c611) Reviewed-on: https://go-review.googlesource.com/2802 Reviewed-by: Andrew Gerrand <adg@golang.org>
…al .bss section Fixes golang#9359. Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/1889 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 1c0c611) Reviewed-on: https://go-review.googlesource.com/2802 Reviewed-by: Andrew Gerrand <adg@golang.org>
…al .bss section Fixes golang#9359. Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/1889 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 1c0c611) Reviewed-on: https://go-review.googlesource.com/2802 Reviewed-by: Andrew Gerrand <adg@golang.org>
…al .bss section Fixes golang#9359. Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/1889 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 1c0c611) Reviewed-on: https://go-review.googlesource.com/2802 Reviewed-by: Andrew Gerrand <adg@golang.org>
on linux/amd64,
go test -c fmt
produces a binary of 3847664 bytes, however,go test -c -race fmt
produces a binary of 14653432 bytes, almost 10MB larger!This issue also affects the 1.4 release.
The problem is that this symbol:
0000000000c09bc0 0000000000982648 d runtime/race(.bss)
which should be put into the bss section, actually consumes space in the binary.
You can also see the problem in the program headers:
The file size and mem size for the RW section is almost identical.
The race runtime syso file is correct, our linker somehow failed to put the bss in real bss.
Should we also fix this for 1.4.1? Every race enabled binary is 10MB larger than it should be right now.
The text was updated successfully, but these errors were encountered: