]> Cypherpunks repositories - gostls13.git/commit
cmd/link: force eager binding when using plugins on darwin
authorCherry Mui <cherryyz@google.com>
Thu, 16 Dec 2021 19:33:13 +0000 (14:33 -0500)
committerCherry Mui <cherryyz@google.com>
Fri, 17 Dec 2021 16:05:31 +0000 (16:05 +0000)
commitc5fee935bbb8f02406eb653cfed550593755a1a4
treeaef450535c89d529fba65cd83d94f4f0b406a697
parent529939072eef730c82333344f321972874758be8
cmd/link: force eager binding when using plugins on darwin

When building/using plugins on darwin, we need to use flat
namespace so the same symbol from the main executable and the
plugin can be resolved to the same address. Apparently, when using
flat namespace the dynamic linker can hang at forkExec when
resolving a lazy binding. Work around it by forcing early bindings.

Fixes #38824.

Change-Id: I983aa0a0960b15bf3f7871382e8231ee244655f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/372798
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
misc/cgo/testplugin/plugin_test.go
misc/cgo/testplugin/testdata/forkexec/main.go [new file with mode: 0644]
src/cmd/link/internal/ld/lib.go