]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/link: invalidate kernel cache on darwin
authorCherry Zhang <cherryyz@google.com>
Sun, 22 Nov 2020 16:43:29 +0000 (11:43 -0500)
committerCherry Zhang <cherryyz@google.com>
Tue, 1 Dec 2020 23:39:15 +0000 (23:39 +0000)
commitcf7aa585ac8b3a2db8e0792d6d7c14259568823e
tree93fc7ba24b03a8734198eccf506433a3d02f083f
parent8cd35e00bd413e68e6b9ae6403aa4209fc89b90f
cmd/link: invalidate kernel cache on darwin

Apparently, the darwin kernel may cache the code signature at
mmap. When we mmap the output buffer, it doesn't have a code
signature (as we haven't generated one). Invalidate the kernel
cache after writing the file.

See https://github.com/golang/go/issues/42684#issuecomment-731704900
for more information.

Updates #38485.
Fixes #42684.

Change-Id: Iac2ef756ca1454c856944423e5040b8e17a6b420
Reviewed-on: https://go-review.googlesource.com/c/go/+/272258
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>
src/cmd/link/internal/ld/outbuf.go
src/cmd/link/internal/ld/outbuf_darwin.go
src/cmd/link/internal/ld/outbuf_notdarwin.go [new file with mode: 0644]