[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>
diff --git a/src/cmd/internal/obj/objfile2.go b/src/cmd/internal/obj/objfile2.go
index 898f0a1..b12b6fe 100644
--- a/src/cmd/internal/obj/objfile2.go
+++ b/src/cmd/internal/obj/objfile2.go
@@ -208,6 +208,11 @@
 		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) {