Commit bb52ceaf authored by David Crawshaw's avatar David Crawshaw

cmd/link: do not align type name data

Now that reflect.name objects contain an offset to pkgPath instead of a
pointer, there is no need to align the symbol data.

Removes approx. 10KB from the cmd/go binary. The effect becomes more
important later as more type data is moved into name objects.

For #6853

Change-Id: Idb507fdbdad04f16fc224378f82272cb5c236ab7
Reviewed-on: https://go-review.googlesource.com/21776
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 63ceeafa
......@@ -1116,7 +1116,7 @@ func symalign(s *LSym) int32 {
} else if s.Align != 0 {
return min
}
if strings.HasPrefix(s.Name, "go.string.") && !strings.HasPrefix(s.Name, "go.string.hdr.") {
if (strings.HasPrefix(s.Name, "go.string.") && !strings.HasPrefix(s.Name, "go.string.hdr.")) || strings.HasPrefix(s.Name, "type..namedata.") {
// String data is just bytes.
// If we align it, we waste a lot of space to padding.
return min
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment