]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: raise pe export cap to 65535
authorJakob Gillich <jakob@gillich.me>
Tue, 16 Jul 2024 17:43:18 +0000 (17:43 +0000)
committerThan McIntosh <thanm@google.com>
Tue, 23 Jul 2024 15:10:37 +0000 (15:10 +0000)
fixes #68405

Change-Id: I043e16f43daa336005695f82a53f9a52cd770656
GitHub-Last-Rev: 69f1ae8b648083154c64f0679b7bd97a118607e9
GitHub-Pull-Request: golang/go#68409
Reviewed-on: https://go-review.googlesource.com/c/go/+/597956
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Zxilly Chou <zxilly@outlook.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/pe.go

index 14f04855305a401e6c6e2f1a88533d7d57de961c..6d6eda4b33640309767858a6f2c17dc203cffa50 100644 (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()
                }