Commit 0acecb71 authored by Russ Cox's avatar Russ Cox

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/12531Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 3b26e8b2
...@@ -337,6 +337,7 @@ const ( ...@@ -337,6 +337,7 @@ const (
SSTRING SSTRING
SGOSTRING SGOSTRING
SGOFUNC SGOFUNC
SGCBITS
SRODATA SRODATA
SFUNCTAB SFUNCTAB
STYPELINK STYPELINK
......
...@@ -1419,6 +1419,9 @@ func defdwsymb(sym *LSym, s string, t int, v int64, size int64, ver int, gotype ...@@ -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.") { if strings.HasPrefix(s, "go.string.") {
return return
} }
if strings.HasPrefix(s, "runtime.gcbits.") {
return
}
if strings.HasPrefix(s, "type.") && s != "type.*" && !strings.HasPrefix(s, "type..") { if strings.HasPrefix(s, "type.") && s != "type.*" && !strings.HasPrefix(s, "type..") {
defgotype(sym) defgotype(sym)
......
...@@ -1793,6 +1793,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { ...@@ -1793,6 +1793,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
obj.SSTRING, obj.SSTRING,
obj.SGOSTRING, obj.SGOSTRING,
obj.SGOFUNC, obj.SGOFUNC,
obj.SGCBITS,
obj.SWINDOWS: obj.SWINDOWS:
if !s.Reachable { if !s.Reachable {
continue continue
......
...@@ -373,6 +373,13 @@ func symtab() { ...@@ -373,6 +373,13 @@ func symtab() {
s.Reachable = true s.Reachable = true
symgofunc := s 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) symtypelink := Linklookup(Ctxt, "runtime.typelink", 0)
symt = Linklookup(Ctxt, "runtime.symtab", 0) symt = Linklookup(Ctxt, "runtime.symtab", 0)
...@@ -411,6 +418,12 @@ func symtab() { ...@@ -411,6 +418,12 @@ func symtab() {
s.Outer = symgostring 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.") { if strings.HasPrefix(s.Name, "go.func.") {
s.Type = obj.SGOFUNC s.Type = obj.SGOFUNC
s.Hide = 1 s.Hide = 1
......
...@@ -9,7 +9,7 @@ ALL=\ ...@@ -9,7 +9,7 @@ ALL=\
all: $(ALL) all: $(ALL)
%.6: %.s %.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 pclntab.s: genpcln.go
go run genpcln.go >pclntab.s go run genpcln.go >pclntab.s
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment