1
0
mirror of https://github.com/golang/go synced 2024-11-26 14:46:47 -07:00

cmd/link: raise pe export cap to 65535

fixes #68405
This commit is contained in:
Jakob Gillich 2024-07-13 00:49:24 +02:00
parent 4e77872d16
commit 69f1ae8b64

View File

@ -16,6 +16,7 @@ import (
"encoding/binary"
"fmt"
"internal/buildcfg"
"math"
"sort"
"strconv"
"strings"
@ -307,7 +308,7 @@ var (
pe64 int
dr *Dll
dexport = make([]loader.Sym, 0, 1024)
dexport []loader.Sym
)
// peStringTable is a COFF string table.
@ -1390,7 +1391,7 @@ func initdynexport(ctxt *Link) {
if !ldr.AttrReachable(s) || !ldr.AttrCgoExportDynamic(s) {
continue
}
if len(dexport)+1 > cap(dexport) {
if len(dexport) >= math.MaxUint16 {
ctxt.Errorf(s, "pe dynexport table is full")
errorexit()
}