From: Russ Cox Date: Wed, 14 Apr 2021 23:53:59 +0000 (-0400) Subject: cmd/link: deal with no constructors X-Git-Tag: go1.17beta1~469 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=41e5ae4883b2f3c32958731ef589488f4fc06449;p=gostls13.git cmd/link: deal with no constructors Change-Id: I6ed153b780c70fa90822e4daa5749478ac43afca Reviewed-on: https://go-review.googlesource.com/c/go/+/312034 Trust: Russ Cox Run-TryBot: Russ Cox Reviewed-by: Cherry Zhang TryBot-Result: Go Bot --- diff --git a/src/cmd/link/internal/ld/pe.go b/src/cmd/link/internal/ld/pe.go index 30654412b9..b70c0693e8 100644 --- a/src/cmd/link/internal/ld/pe.go +++ b/src/cmd/link/internal/ld/pe.go @@ -607,6 +607,10 @@ dwarfLoop: Errorf(nil, "emitRelocations: could not find %q section", sect.Name) } + if f.ctorsSect == nil { + return + } + f.ctorsSect.emitRelocations(ctxt.Out, func() int { dottext := ldr.Lookup(".text", 0) ctxt.Out.Write32(0)