]> Cypherpunks repositories - gostls13.git/commit
cmd/link, etc: store typelinks as offsets
authorDavid Crawshaw <crawshaw@golang.org>
Sun, 27 Mar 2016 14:21:48 +0000 (10:21 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Tue, 12 Apr 2016 20:32:41 +0000 (20:32 +0000)
commitf028b9f9e2433662502283850d06e9e07e72a6bb
tree4143e317fd9cea9762d9a76dc4ddc83ec4f997d3
parent23cbfa2545a735eca5ffc1ffd6c0e93c2eecac2a
cmd/link, etc: store typelinks as offsets

This is the first in a series of CLs to replace the use of pointers
in binary read-only data with offsets.

In standard Go binaries these CLs have a small effect, shrinking
8-byte pointers to 4-bytes. In position-independent code, it also
saves the dynamic relocation for the pointer. This has a significant
effect on the binary size when building as PIE, c-archive, or
c-shared.

darwin/amd64:
cmd/go: -12KB (0.1%)
jujud:  -82KB (0.1%)

linux/amd64 PIE:
cmd/go:  -86KB (0.7%)
jujud:  -569KB (0.7%)

For #6853.

Change-Id: Iad5625bbeba58dabfd4d334dbee3fcbfe04b2dcf
Reviewed-on: https://go-review.googlesource.com/21284
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
12 files changed:
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/internal/obj/data.go
src/cmd/internal/obj/link.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/symtab.go
src/reflect/export_test.go
src/reflect/type.go
src/runtime/runtime1.go
src/runtime/symtab.go