cmd/link: broken with binutils that generates STT_COMMON symbols #18088
Labels
Comments
Can you try Go master? (what will be Go 1.8) Or wait a few days for the first beta if you don't want to run |
CL https://golang.org/cl/33653 mentions this issue. |
I can confirm that it happens on master and that https://golang.org/cl/33653 fixes it. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
We built binutils with
--enable-elf-stt-common
. This makes the gnu assembler/objcopy and ld default to generating common symbols with theSTT_COMMON
type.What did you see?
This makes go break at runtime with:
If binutils was not configured this way, this should be reproducible by passing
--elf-stt-common=yes
and-z common
to the assembler and linker respectively when builing go. I wasn't able to do this but that's probably due to my unfamiliarity with go's build system.How to fix this?
go could pass
--elf-stt-common=no
and-z nocommon
when building itself or anything else. However I don't think that's workable, as then it would not be able to link to objects that were created with those flags set.The text was updated successfully, but these errors were encountered: