Compatibility issue with go

I spent most of the day trying to figure out why go packages were
failing to build when lld was the system linker.

I finally got to what IMHO is an issue in go:
link assumes that there is only one section symbol per section · Issue #19018 · golang/go · GitHub.

I will still give it a try tomorrow to see how hard it would be to work
around it in lld, but just wanted to share in case anyone else was
hitting the same problem.

Cheers,
Rafael

Does Go use the system linker? Go is written in Go, and I was thinking that the Go toolchain includes everything from a compiler to a standard library to a linker, and depends on very little on the host system.

Rui Ueyama <ruiu@google.com> writes:

Does Go use the system linker? Go is written in Go, and I was thinking that
the Go toolchain includes everything from a compiler to a standard library
to a linker, and depends on very little on the host system.

Looks like all that they are missing is "ld -r" :frowning:

Cheers,
Rafael

The attached patch fixes the issue with Elf_Rela. I checked that the
go binary now works.

Unfortunately it completely breaks -r with Elf_Rel. I am investigating
what is the best way to fix it.

Cheers,
Rafael

t.diff (7.68 KB)