1
0
mirror of https://github.com/golang/go synced 2024-11-26 13:08:08 -07:00

cmd/link: deal with no constructors

Change-Id: I6ed153b780c70fa90822e4daa5749478ac43afca
Reviewed-on: https://go-review.googlesource.com/c/go/+/312034
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Russ Cox 2021-04-14 19:53:59 -04:00
parent 9f7079c44e
commit 41e5ae4883

View File

@ -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)