From 946af1b658c319d70e2a6f0d0d6aedc972c3acc6 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Fri, 23 Mar 2018 13:12:07 -0700 Subject: [PATCH] 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 --- src/cmd/link/internal/ld/lib.go | 4 ++++ 1 file changed, 4 insertions(+) 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() -- 2.50.0