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: silently performs incorrect relocations when linking foreign objects #24321

infinity0 opened this Issue Mar 9, 2018 · 5 comments


None yet
5 participants

infinity0 commented Mar 9, 2018

For example, when linking syso files.

Adding go:cgo_import_dynamic helps but (1) it was recently disabled for security reasons for non-cgo files, then reenabled because solaris needs it, so it's unclear if this policy will persist in the long-run for all architectures, and (2) you need to specify it for specific symbols rather than for all symbols. In any case, an error should be raised with a hint on what to do, rather than succeeding silently with invalid output.

The equivalent thing in Haskell Just Works with no extra annotations.


This comment has been minimized.


andybons commented Mar 9, 2018


This comment has been minimized.


ianlancetaylor commented Mar 9, 2018

Can you show us a self-contained example?

Does it work if you use -ldflags=-linkmode=external?

Perhaps we should default to external linking mode in the presence of any syso files.


This comment has been minimized.

gopherbot commented Apr 12, 2018

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Apr 12, 2018


This comment has been minimized.


FiloSottile commented Apr 12, 2018

Reopening, I can provide a test case from FiloSottile/ed25519-dalek-rustgo#1.


This comment has been minimized.


andybons commented Apr 13, 2018

Removing the WaitingForInfo tag worked around GopherBot fighting you :P.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment