Skip to content

runtime, cmd/compile: between Go1.25.5 and GoTip, with same generated ASM, document binary size increase for very small programs #77049

@odeke-em

Description

@odeke-em

Go version

Go 1.25.5

Output of go env in your module/workspace:

On Linux, Windows and Freebsd GOARCH=amd64

What did you do?

With this simple program https://odex.orijtech.com/p/3hiUoOSI or inlined below

package main

import "runtime"

func main() {
}

var _ = (*runtime.MemStats)(nil)

When compiled on Linux/amd64, the generated assembly is purported to be the same per https://odex.orijtech.com/p/3hiUoOSI#asm.diff

Image

What did you see happen?

However when I examine the binary size per https://odex.orijtech.com/p/3hiUoOSI#bin-diff.size I see some changes in binary size on Linux/amd64 and Windows/amd64, FreeBSD/amd 64 but not on Darwin/amd64

Image
And digging into packages and the symbols we see a culprit

Image
Image

Yet even no source diff between versions

Image

What did you expect to see?

No size difference given code hasn’t changed nor has the generated assembly

Most definitely we might have some alignment issues that have caused this bloat.

Kindly cc-ing @prattmic @randall77 @mknyszek @cherrymui @ianlancetaylor.

Thank you and happy new year!

Metadata

Metadata

Assignees

Labels

BugReportIssues describing a possible bug in the Go implementation.DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions