-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: ELF external linking puts all symbols in dynamic symbol table #53579
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
Change https://go.dev/cl/414654 mentions this issue: |
Interesting that there are so many linkers that don't have |
I think we're just seeing builders using older versions of the GNU linker. I don't think the GNU linker provides any other mechanism. |
Re "how long can the command line get": instead of |
I don't think we can safely use |
Fair enough. I think with lld the various flags can be combined and the symbol lists are merged, but I also don't find the documentation entirely clear. |
Currently external linking on ELF systems passes
-rdynamic
to the external linker, which tells it to put all exported symbols into the dynamic symbol table. This is unnecessary in the normal case. It wastes space in the executable, and effectively disables garbage collection in the external linker. We should instead only export symbols that may need to be exported.I have a patch for this which we can try for the 1.20 release.
The text was updated successfully, but these errors were encountered: