Commit 9ed736a
committed
cmd/link/internal: fix use of DynlinkingGo with ppc64le trampolines
When creating programs with large text sections on ppc64le,
trampolines are needed for calls that are too far; however
they are not created if the code is generated such that the TOC
register r2 is initialized and maintained in the code because
then the external linker can create the trampolines. Previously
the function DynlinkingGo was used to determine this but in the
case where plugins are used, this could return true even though
r2 is not valid.
To fix this problem I've added a new function r2Valid which returns
true when the build options indicate that the r2 is
initialized and maintained. Because of the ways that
DynlinkingGo is used I wanted to maintain its previous
behavior.
Fixes #45850
Change-Id: I6d902eba6ad41757aa6474948b79acdbd479cb38
Reviewed-on: https://go-review.googlesource.com/c/go/+/315289
Trust: Lynn Boger <[email protected]>
Run-TryBot: Lynn Boger <[email protected]>
Reviewed-by: Cherry Zhang <[email protected]>
TryBot-Result: Go Bot <[email protected]>1 parent 30674ae commit 9ed736a
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
654 | 664 | | |
655 | 665 | | |
656 | 666 | | |
657 | 667 | | |
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
661 | | - | |
| 671 | + | |
662 | 672 | | |
663 | 673 | | |
664 | 674 | | |
| |||
712 | 722 | | |
713 | 723 | | |
714 | 724 | | |
715 | | - | |
| 725 | + | |
716 | 726 | | |
717 | 727 | | |
718 | 728 | | |
| |||
0 commit comments