Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/link: testdata rebuilding has bitrotted and tests fail when it is refreshed #10501
The Makefile in cmd/link/testdata invokes go tool 6a to rebuild the .6 files, which obviously no longer works. When that's fixed like this:
--- a/src/cmd/link/testdata/Makefile +++ b/src/cmd/link/testdata/Makefile @@ -9,7 +9,7 @@ ALL=\ all: $(ALL) %.6: %.s - GOARCH=amd64 GOOS=darwin go tool 6a -trimpath=$(shell pwd) $*.s + GOARCH=amd64 GOOS=darwin go tool asm -I $(shell go env GOROOT)/pkg/include -trimpath=$(shell pwd) $*.s pclntab.s: genpcln.go go run genpcln.go >pclntab.s
go test cmd/link fails like this:
Which suggests cmd/internal/goobj hasn't kept up to date with object file format changes -- not sure what though, that hasn't changed in a whlie (and I want to change it now!)
The Makefile change looks right to me.
For the "unknown relocation type" errors, it seems that cmd/link/load.go has its own set of relocation type definitions that aren't being kept in sync with the rest of the toolchain. E.g., cmd/internal/obj and cmd/internal/obj define R_PCREL = 11, but cmd/link/load.go has R_PCREL = 7.
It seems something similar has happened with package cmd/internal/goobj: it thinks STLSBSS is 23, but that value is assigned to SNOPTRBSS in cmd/internal/ld/link.go.