1
0
mirror of https://github.com/golang/go synced 2024-11-23 09:40:04 -07:00

cmd/link: elide individual gcbits symbols

Same as we do for string symbols.

Fixes #11583.

Change-Id: Ia9264f6faf486697d987051b7f9851d37d8ad381
Reviewed-on: https://go-review.googlesource.com/12531
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2015-07-22 14:59:56 -04:00
parent 3b26e8b29a
commit 0acecb7164
11 changed files with 19 additions and 1 deletions

View File

@ -337,6 +337,7 @@ const (
SSTRING
SGOSTRING
SGOFUNC
SGCBITS
SRODATA
SFUNCTAB
STYPELINK

View File

@ -1419,6 +1419,9 @@ func defdwsymb(sym *LSym, s string, t int, v int64, size int64, ver int, gotype
if strings.HasPrefix(s, "go.string.") {
return
}
if strings.HasPrefix(s, "runtime.gcbits.") {
return
}
if strings.HasPrefix(s, "type.") && s != "type.*" && !strings.HasPrefix(s, "type..") {
defgotype(sym)

View File

@ -1793,6 +1793,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
obj.SSTRING,
obj.SGOSTRING,
obj.SGOFUNC,
obj.SGCBITS,
obj.SWINDOWS:
if !s.Reachable {
continue

View File

@ -373,6 +373,13 @@ func symtab() {
s.Reachable = true
symgofunc := s
s = Linklookup(Ctxt, "runtime.gcbits.*", 0)
s.Type = obj.SGCBITS
s.Local = true
s.Size = 0
s.Reachable = true
symgcbits := s
symtypelink := Linklookup(Ctxt, "runtime.typelink", 0)
symt = Linklookup(Ctxt, "runtime.symtab", 0)
@ -411,6 +418,12 @@ func symtab() {
s.Outer = symgostring
}
if strings.HasPrefix(s.Name, "runtime.gcbits.") {
s.Type = obj.SGCBITS
s.Hide = 1
s.Outer = symgcbits
}
if strings.HasPrefix(s.Name, "go.func.") {
s.Type = obj.SGOFUNC
s.Hide = 1

View File

@ -9,7 +9,7 @@ ALL=\
all: $(ALL)
%.6: %.s
GOARCH=amd64 GOOS=darwin go tool asm -I $(shell go env GOROOT)/pkg/include -trimpath=$(shell pwd) $*.s
GOARCH=amd64 GOOS=darwin go tool asm -o $*.6 -I $(shell go env GOROOT)/pkg/include -trimpath=$(shell pwd) $*.s
pclntab.s: genpcln.go
go run genpcln.go >pclntab.s

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.