Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: handle too far branches in ppc64le with trampolines in external linking in Go 1.9 #17917

laboger opened this issue Nov 14, 2016 · 5 comments


Copy link

@laboger laboger commented Nov 14, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?


What operating system and processor architecture are you using (go env)?

Ubuntu 16.04 ppc64le

Opening this issue to document work be done in Go 1.9. This is related to the problem in #15823 and its fix.

Sometime after I created a fix for this problem, the same issue happened on arm, and @cherrymui created a fix that uses trampolines for both internal and external linking.

My original fix was based on splitting the text sections if they are larger than the branch offset limit, because then the external linker can take care of adding long branches or trampolines where needed. But that method is only done with external linking.

Cherry asked that I change my fix to use trampolines for external linking on ppc64le so it is consistent with arm. I'm opening this issue to note that work to be done in Go 1.9.

Also, the fix with external linking can result in the ftab (functab) being out of sync with the function addresses in the final binary. When the work to fully implement trampolines on ppc64le with external linking is done, that problem should go away but that needs to be verified.

@bradfitz bradfitz added this to the Go1.9 milestone Nov 14, 2016
Copy link
Contributor Author

@laboger laboger commented Apr 24, 2017

The problem mentioned here is already fixed in golang for ppc64le, but the reason for this issue is to modify the code so it uses the same implementation as is done in arm. So this is not a fix for a bug but a clean up of the code. I will not be able to finish that clean up work for go 1.9.

Copy link

@gopherbot gopherbot commented Jun 8, 2017

CL mentions this issue.

Copy link
Contributor Author

@laboger laboger commented Jun 16, 2017

@cherrymui @ianlancetaylor Based on the discussion in #20492 we will not be removing the capability of splitting text sections, so this is longer needed. Do you agree?

Copy link

@cherrymui cherrymui commented Jun 16, 2017

Yes, I think so.

Copy link
Contributor Author

@laboger laboger commented Oct 2, 2017

It was decided we would not use this method for all cases, so the current implementation is what we want and this can be closed.

@laboger laboger closed this Oct 2, 2017
@golang golang locked and limited conversation to collaborators Oct 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.