]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/compile: use hash of export data as fingerprint
authorCherry Zhang <cherryyz@google.com>
Mon, 1 Jun 2020 22:53:58 +0000 (18:53 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 4 Jun 2020 16:06:18 +0000 (16:06 +0000)
commit7795523910227cb6df3c91ebdb317037fc9ceb86
treec6e479cf79e4363e14ab8d220e42c66bd2cc18af
parent4cc043d883b08b067234e5bdc771bef2ef962112
[dev.link] cmd/compile: use hash of export data as fingerprint

Currently, the compiler generates a fingerprint for each package,
which is used by the linker for index consistency check.

When building plugin or shared object, currently the linker also
generates a hash, by hashing the export data. At run time, when
a package is referenced by multiple DSOs, this hash is compared
to ensure consistency.

It would be good if we can unify this two hashes. This way, the
linker doesn't need to read the export data (which is intended
for the compiler only, and is not always available for the
linker). The export data hash is sufficient for both purposes.
It is consistent with the current hash geneated by the linker.
And the export data includes indices for exported symbols, so its
hash can be used to catch index mismatches.

Updates #33820.

Change-Id: I2bc0d74930746f54c683a10dfd695d50ea3f5a38
Reviewed-on: https://go-review.googlesource.com/c/go/+/236118
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/gc/iexport.go
src/cmd/internal/obj/sym.go