-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: external link for mips64 #12560
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
Comments
Implement external linking for mips64. This involves completing the functions needed for external linking in src/cmd/link/internal/mips64/asm.go, including elfreloc1 and archreloc. (My original comment included cgo and internal linking. I have revised it to cover only external linking, and opened #14126 for complete cgo with external linking.) |
I think that's a little inaccurate and muddles implementing cgo and external linking. External linking mostly just requires elfreloc1 (it might also require changes to the entrypoint?). elfsetupplt, adddynsym, adddynrela are required for cgo with internal linking (they are not implemented for arm64, for example, which only supports cgo via external linking). The runtime stuff in asm_mips64x.s is required for either flavour of cgo, but not external linking. |
Thanks @mwhudson for helping un-muddle my understanding of cgo vs. internal linking vs. external linking. So to build a Go program with embedded C code (via extern "C") that calls functions in an external library, I need just
but not the internal linking support in elfsetupplt, adddynsym, adddynrela. Is that correct? |
Yes. Some small modification to other parts of the runtime
will be needed for cgo, but that shouldn't take too much
time.
|
I reverted the issue description to cover only external linking, and opened #14126 for complete cgo support. |
CL https://golang.org/cl/19803 mentions this issue. |
No description provided.
The text was updated successfully, but these errors were encountered: