diff --git a/src/cmd/link/internal/ld/sym.go b/src/cmd/link/internal/ld/sym.go index 6122b85298b..099243442b6 100644 --- a/src/cmd/link/internal/ld/sym.go +++ b/src/cmd/link/internal/ld/sym.go @@ -58,7 +58,8 @@ var headers = []struct { func linknew(arch *LinkArch) *Link { ctxt := new(Link) - ctxt.Hash = make(map[symVer]*LSym) + // Preallocate about 2mb for hash + ctxt.Hash = make(map[symVer]*LSym, 100000) ctxt.Arch = arch ctxt.Version = obj.HistVersion ctxt.Goroot = obj.Getgoroot()