Skip to content
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: testdata rebuilding has bitrotted and tests fail when it is refreshed #10501

Closed
mwhudson opened this issue Apr 19, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@mwhudson
Copy link
Contributor

commented Apr 19, 2015

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:

--- FAIL: TestAuto (0.00s)
    auto_test.go:32: zeronoptr: unexpected symbol kind STLSBSS
    auto_test.go:32: nonzeronoptr: unexpected symbol kind STLSBSS
    auto_test.go:32: start: unknown relocation type 11
    auto_test.go:32: start: unknown relocation type 11
--- FAIL: TestLayout (0.00s)
    layout_test.go:16: noptrdata_sym: unexpected symbol kind STLSBSS
    layout_test.go:16: noptrbss_sym: unexpected symbol kind STLSBSS
--- FAIL: TestLinkHello (0.00s)
    link_test.go:18: _rt0_go: unknown relocation type 11
--- FAIL: TestPclntab (0.00s)
    pclntab_test.go:27: start: unknown relocation type 11

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!)

@mdempsky

This comment has been minimized.

Copy link
Member

commented Apr 20, 2015

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.

@mwhudson

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2015

Yes, I came to the same conclusion: https://go-review.googlesource.com/9105
On 20/04/2015 12:58 PM, "Matthew Dempsky" notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHub
#10501 (comment).

@golang golang locked and limited conversation to collaborators Jun 25, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.