From: David Crawshaw Date: Fri, 8 Apr 2016 00:07:09 +0000 (-0400) Subject: cmd/link: do not align type name data X-Git-Tag: go1.7beta1~541 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bb52ceafea60dc4688b6c6b71f241752ce597db8;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 6fc6de3818..63caf9cf79 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -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