mirror of
https://github.com/golang/go
synced 2024-11-23 12:20:12 -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:
parent
3b26e8b29a
commit
0acecb7164
@ -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
|
|||||||
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)) {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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
|
||||||
|
2
src/cmd/newlink/testdata/Makefile
vendored
2
src/cmd/newlink/testdata/Makefile
vendored
@ -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
|
||||||
|
BIN
src/cmd/newlink/testdata/autosection.6
vendored
BIN
src/cmd/newlink/testdata/autosection.6
vendored
Binary file not shown.
BIN
src/cmd/newlink/testdata/autoweak.6
vendored
BIN
src/cmd/newlink/testdata/autoweak.6
vendored
Binary file not shown.
BIN
src/cmd/newlink/testdata/dead.6
vendored
BIN
src/cmd/newlink/testdata/dead.6
vendored
Binary file not shown.
BIN
src/cmd/newlink/testdata/hello.6
vendored
BIN
src/cmd/newlink/testdata/hello.6
vendored
Binary file not shown.
BIN
src/cmd/newlink/testdata/layout.6
vendored
BIN
src/cmd/newlink/testdata/layout.6
vendored
Binary file not shown.
BIN
src/cmd/newlink/testdata/pclntab.6
vendored
BIN
src/cmd/newlink/testdata/pclntab.6
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user