Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
What version of Go are you using (
This adds a new test that builds a small Go program with linked against a *.syso file that is the result of an "ld -r" link. The sysobj in question has multiple static symbols in the same section with the same name, which triggered a bug in the loader in -newobj mode. Updates #35779. Change-Id: Ibe1a75662dc1d49c4347279e55646ee65a81508e Reviewed-on: https://go-review.googlesource.com/c/go/+/208478 Reviewed-by: Cherry Zhang <email@example.com>
https://build.golang.org/log/98d47379c6065fd00edcd68aa384451c5deae722 elf_test.go:202: # elf_test loadelf: $WORK/b001/_pkg_.a(ldr.syso): malformed elf file: invalid elf symbol index
https://build.golang.org/log/ad7532a8bd9457571fe394269d7a017b82abe21e elf_test.go:202: # elf_test /tmp/gobuilder-mips64/tmp/go-build246906970/b001/_pkg_.a(ldr.syso): unknown relocation type 333831; compiled without -fpic?
Skip TestMinusRSymsWithSameName testpoint on MIPS for the time being since it triggers failures on that arch. Will re-enable once the problems are fixed. Updates #35779. Change-Id: I3e6650158ab04a2be77e3db5a5194df3bbb0859e Reviewed-on: https://go-review.googlesource.com/c/go/+/208557 Reviewed-by: Cherry Zhang <firstname.lastname@example.org>
The previous fix for this issue (CL 208479) was not general enough; this patch revises it to handle more cases. The problem with the original fix was that once a sym.Symbol is created for a given static symbol and given a bogus anonymous version of -1, we hit problems if some other non-anonymous symbol (created by host object loading) had relocations targeting the static symbol. In this patch instead of assigning a fixed anonymous version of -1 to such symbols, each time loader.Create is invoked we create a new (unique) anonymous version for the sym.Symbol, then enter the result into the loader's extStaticSyms map, permitting it to be found in lookups when processing relocation targets. NB: this code will hopefully get a lot simpler once we can move host object loading away from early sym.Symbol creation. Updates #35779. Change-Id: I450ff577e17549025565d355d6707a2d28a5a617 Reviewed-on: https://go-review.googlesource.com/c/go/+/208778 Run-TryBot: Than McIntosh <email@example.com> Reviewed-by: Cherry Zhang <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com>