]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/internal/buildid: update Mach-O code signature when rewriting buildid
authorCherry Zhang <cherryyz@google.com>
Sun, 22 Nov 2020 02:24:57 +0000 (21:24 -0500)
committerCherry Zhang <cherryyz@google.com>
Tue, 1 Dec 2020 23:37:58 +0000 (23:37 +0000)
commit8cd35e00bd413e68e6b9ae6403aa4209fc89b90f
treebd2debc003629ffd189f229d37d9c9f13fdafaec
parent6f84993e90e7076427c1bd0aaebe4e10b764194a
cmd/internal/buildid: update Mach-O code signature when rewriting buildid

As the code signature contains hashes of the entire file (except
the signature itself), rewriting buildid will invalidate the
signature. This CL makes it regenerate the signature when
rewriting the buildid. It only does it when the file already has
a code signature, with proper size (darwin/arm64 binaries
generated by the Go linker should have).

Updates #38485, #42684.

Change-Id: I082d9e5808b0ee6a35f9c362d7262aadd9113c81
Reviewed-on: https://go-review.googlesource.com/c/go/+/272257
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/buildid/buildid.go
src/cmd/go/internal/work/buildid.go
src/cmd/internal/buildid/rewrite.go