mirror of
https://github.com/golang/go
synced 2024-11-23 13:00:07 -07:00
[dev.link] cmd/internal/obj: don't write builtin names in obj writer
Change the object file writer to avoid adding entries to the object file string table for builtin functions. This helps save some very small amount of space in the object file. Change-Id: Ic3b94a154e00eb4c7378b57613580c7073b841bc Reviewed-on: https://go-review.googlesource.com/c/go/+/239657 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
This commit is contained in:
parent
a89fd32316
commit
be38746eb4
@ -208,6 +208,11 @@ func (w *writer) StringTable() {
|
||||
if w.pkgpath != "" {
|
||||
s.Name = strings.Replace(s.Name, "\"\".", w.pkgpath+".", -1)
|
||||
}
|
||||
// Don't put names of builtins into the string table (to save
|
||||
// space).
|
||||
if s.PkgIdx == goobj2.PkgIdxBuiltin {
|
||||
return
|
||||
}
|
||||
w.AddString(s.Name)
|
||||
})
|
||||
w.ctxt.traverseSyms(traverseDefs, func(s *LSym) {
|
||||
|
Loading…
Reference in New Issue
Block a user