-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: binary on darwin takes up more space on disk #39044
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
Comments
Note that copying the result to a new file fixes the problem. |
Hmmm. https://tip.golang.org/src/cmd/link/internal/ld/outbuf_darwin.go
I wonder if F_PEOFPOSMODE is right here. It seems
So if we preallocate more than once, the second and later calls will allocate the whole size on top of the existing size... |
Or we should subtract the existing size. |
Change https://golang.org/cl/234481 mentions this issue: |
Shouldn't this be milestoned for 1.15? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No (as in this is a regression in the current master, the latest stable is fine)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I noticed my binary went from 8MB (1.14.2) to 13MB (master), but only when running
du -sh
or inspecting the binary in Finder (under "how much it takes on disk").When stating both binaries, they are very similar in size, so this issue only revolves around disk usage, not size.
I replicated the issue by creating a hello world app
And then I bisected it, starting at 1811533 (good) and ending at cb11c98 (bad).
Bisect identified 8ab37b1 as the first offending commit. I verified it manually - the commit before that leads to a 2.1MB binary on disk, this commit leads to 4.1MB on disk.
I could not replicate this on a Ubuntu 18.04 box, so I presume it's a Darwin thing.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: