]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] cmd/link: handle dynamic import variables on Darwin in plugin...
authorCherry Mui <cherryyz@google.com>
Mon, 17 Jun 2024 18:44:42 +0000 (14:44 -0400)
committerJoedian Reid <joedian@google.com>
Wed, 26 Jun 2024 22:22:41 +0000 (22:22 +0000)
commitc2d4f852ce69fc2674d45ccd3090757dd01cc2d4
treefcd9628f2c958b97a06985b58c8b2bc2bb6eed73
parent32229514396234a25d910ab26a4e5194671a2c9f
[release-branch.go1.22] cmd/link: handle dynamic import variables on Darwin in plugin mode

CL 501855 added support for cgo_dynamic_import variables on Darwin.
But it didn't support the plugin build mode on amd64, where the
assembler turns a direct load (R_PCREL) to a load via GOT
(R_GOTPCREL). This CL adds the support. We just need to handle
external linking mode, as this can only occur in plugin or shared
build mode, which requires external linking.

Fixes #68122.
Updates #67976.
Updates #50891.

Change-Id: I0f56265d50bfcb36047fa5538ad7a5ec77e7ef96
Reviewed-on: https://go-review.googlesource.com/c/go/+/592499
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 44f18706661db8b865719d15a5cfa0515d1a4fca)
Reviewed-on: https://go-review.googlesource.com/c/go/+/595175
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/cgo/internal/testplugin/plugin_test.go
src/cmd/cgo/internal/testplugin/testdata/issue67976/plugin.go [new file with mode: 0644]
src/cmd/link/internal/amd64/asm.go