Skip to content

cmd/link: need to handle new-style loong64 relocs #63725

@abner-chenc

Description

@abner-chenc

What version of Go are you using (go version)?

$ go version
go version go1.21.3 linux/loong64

Does this issue reproduce with the latest release?

Yes (found during packaging testing)

What operating system and processor architecture are you using (go env)?

Debian Linux sid, Loongson 3A5000.

go env Output
$ go env

What did you do?

cd $GOROOT/src/cmd/link && go test ./...

What did you expect to see?

all tests pass

What did you see instead?

ok  	cmd/internal/src	0.013s
ok  	cmd/internal/test2json	0.779s
--- FAIL: TestMinusRSymsWithSameName (0.76s)
    elf_test.go:164: gcc [-fPIC -mabi=lp64d -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4287643683=/tmp/go-build -gno-record-gcc-switches] -c -o /tmp/TestMinusRSymsWithSameName5512364/001/x0.o /tmp/TestMinusRSymsWithSameName5512364/001/x0.c
    elf_test.go:164: gcc [-fPIC -mabi=lp64d -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4287643683=/tmp/go-build -gno-record-gcc-switches] -c -o /tmp/TestMinusRSymsWithSameName5512364/001/x1.o /tmp/TestMinusRSymsWithSameName5512364/001/x1.c
    elf_test.go:172: gcc [-fPIC -mabi=lp64d -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4287643683=/tmp/go-build -gno-record-gcc-switches] -nostdlib -r -o /tmp/TestMinusRSymsWithSameName5512364/001/ldr.syso [/tmp/TestMinusRSymsWithSameName5512364/001/x0.o /tmp/TestMinusRSymsWithSameName5512364/001/x1.o]
    elf_test.go:192: /root/debian-upstream/golang-1.21-1.21.3/bin/go build
    elf_test.go:197: # elf_test
        /tmp/go-build2943499130/b001/_pkg_.a(ldr.syso): unknown relocation type 66; compiled without -fpic?
    elf_test.go:198: exit status 1
FAIL
FAIL	cmd/link	13.001s
ok  	cmd/link/internal/benchmark	0.023s

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.arch-loong64Issues solely affecting the loongson architecture.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions