]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: make sure we're hashing __.PKGDEF in genhash
authorMatthew Dempsky <mdempsky@google.com>
Fri, 23 Mar 2018 20:12:07 +0000 (13:12 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 23 Mar 2018 22:28:03 +0000 (22:28 +0000)
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 <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go

index 030491a5501cf52b2afd7646645227ffcc141094..fe21e635dc53d262b7b3087b5236cae3f5f25f20 100644 (file)
@@ -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()