]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.16] cmd/link: generate trampoline for inter-dependent packages
authorCherry Zhang <cherryyz@google.com>
Tue, 16 Feb 2021 15:20:58 +0000 (10:20 -0500)
committerAlexander Rakoczy <alex@golang.org>
Thu, 25 Mar 2021 18:34:20 +0000 (18:34 +0000)
commit9c7463ca903863a0c67b3f76454b37da0a400c13
treef441182cc50a6d4593040ddda51e7e743ddba2e3
parentac59d7abb9ab5ec31cb0fe1eaccbdf3b17edbde0
[release-branch.go1.16] cmd/link: generate trampoline for inter-dependent packages

Currently, in the trampoline generation pass we expect packages
are laid out in dependency order, so a cross-package jump always
has a known target address so we can check if a trampoline is
needed. With linknames, there can be cycles in the package
dependency graph, making this algorithm no longer work. For them,
as the target address is unkown we conservatively generate a
trampoline. This may generate unnecessary trampolines (if the
packages turn out laid together), but package cycles are extremely
rare so this is fine.

Updates #44639.
Fixes #44640.

Change-Id: I2dc2998edacbda27d726fc79452313a21d07787a
Reviewed-on: https://go-review.googlesource.com/c/go/+/292490
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
(cherry picked from commit 098504c73ff6ece19566a1ac811ceed73be7c81d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/296909
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ppc64/asm.go