mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
23cbfa2545
commit
f028b9f9e2
12 changed files with 99 additions and 42 deletions
|
|
@ -457,6 +457,9 @@ const (
|
|||
// R_ADDRMIPS (only used on mips64) resolves to a 32-bit external address,
|
||||
// by loading the address into a register with two instructions (lui, ori).
|
||||
R_ADDRMIPS
|
||||
// R_ADDROFF resolves to an offset from the beginning of the section holding
|
||||
// the data being relocated to the referenced symbol.
|
||||
R_ADDROFF
|
||||
R_SIZE
|
||||
R_CALL
|
||||
R_CALLARM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue