diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index ecb24542124..0ded45ed19b 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -1576,6 +1576,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, linkobj = append(linkobj, ofile) outObj = append(outObj, ofile) } + linkobj = append(linkobj, p.SysoFiles...) dynobj := obj + "_cgo_.o" if goarch == "arm" && goos == "linux" { // we need to use -pie for Linux/ARM to get accurate imported sym cgoLDFLAGS = append(cgoLDFLAGS, "-pie")