From: Matthew Dempsky Date: Fri, 23 Mar 2018 20:12:07 +0000 (-0700) Subject: cmd/link: make sure we're hashing __.PKGDEF in genhash X-Git-Tag: go1.11beta1~1130 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=946af1b658c319d70e2a6f0d0d6aedc972c3acc6;p=gostls13.git cmd/link: make sure we're hashing __.PKGDEF in genhash This is currently always the case because loadobjfile complains if it's not, but that will be changed soon. Updates #24512. Change-Id: I262daca765932a0f4cea3fcc1cc80ca90de07a59 Reviewed-on: https://go-review.googlesource.com/102280 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 030491a550..fe21e635dc 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -731,6 +731,10 @@ func genhash(ctxt *Link, lib *sym.Library) { Errorf(nil, "%s: short read on archive file symbol header", lib.File) return } + if arhdr.name != pkgdef { + Errorf(nil, "%s: missing package data entry", lib.File) + return + } h := sha1.New()