diff options
| author | David Crawshaw <crawshaw@golang.org> | 2016-04-07 20:07:09 -0400 |
|---|---|---|
| committer | David Crawshaw <crawshaw@golang.org> | 2016-04-22 10:07:40 +0000 |
| commit | bb52ceafea60dc4688b6c6b71f241752ce597db8 (patch) | |
| tree | 7fa43e50425b404e8ce87c5d4eae62dcfd3406da /src | |
| parent | 63ceeafa308b99e6b7d5480521b83360b4f6b2fd (diff) | |
| download | go-bb52ceafea60dc4688b6c6b71f241752ce597db8.tar.xz | |
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: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/link/internal/ld/data.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
