diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-09-24 13:50:22 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-10-05 15:47:07 +0000 |
| commit | cfd74f7727f6ad5a81d574c28cbee52cc13fdc52 (patch) | |
| tree | 685d4822219674969d09bc9076af3e060afb273b /src/cmd/internal/obj/objfile.go | |
| parent | 7983830423ca0017dc5d990532e28df13862dc2d (diff) | |
| download | go-cfd74f7727f6ad5a81d574c28cbee52cc13fdc52.tar.xz | |
cmd/link: move all FUNCDATA refs into go.func.*
This change moves all symbols referred to by FUNCDATA
into go.func.* and go.funcrel.*.
Surprisingly (because it inhibits some content-addressability),
it shrinks binaries by a little bit, about 0.1%.
This paves the way for a subsequent change to change
FUNCDATA relocations to offsets.
Change-Id: I70e487205073699f442192b0791cc92da5663057
Reviewed-on: https://go-review.googlesource.com/c/go/+/352189
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/obj/objfile.go')
| -rw-r--r-- | src/cmd/internal/obj/objfile.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 0f3356f85e..687cddc70c 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -408,7 +408,21 @@ func contentHashSection(s *LSym) byte { name := s.Name if s.IsPcdata() { return 'P' - } else if strings.HasPrefix(name, "type.") { + } + if strings.HasPrefix(name, "runtime.gcbits.") { + return 'G' // gcbits + } + if strings.HasPrefix(name, "gcargs.") || + strings.HasPrefix(name, "gclocals.") || + strings.HasPrefix(name, "gclocals·") || + strings.HasSuffix(name, ".opendefer") || + strings.HasSuffix(name, ".arginfo0") || + strings.HasSuffix(name, ".arginfo1") || + strings.HasSuffix(name, ".args_stackmap") || + strings.HasSuffix(name, ".stkobj") { + return 'F' // go.func.* or go.funcrel.* + } + if strings.HasPrefix(name, "type.") { return 'T' } return 0 |
