Skip to content

cmd/link: RISC-V external link, failed to find text symbol for HI20 relocation #65646

Closed
@Xeonacid

Description

@Xeonacid

Go version

go version go1.22.0 linux/riscv64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='riscv64'
GOBIN=''
GOCACHE='/home/xeonacid/.cache/go-build'
GOENV='/home/xeonacid/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS='-buildmode=pie -ldflags=-linkmode=external'
GOHOSTARCH='riscv64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/xeonacid/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/xeonacid/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_riscv64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/xeonacid/rekor/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build549560519=/tmp/go-build -gno-record-gcc-switches'

What did you do?

export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external"
git clone https://github.com/sigstore/rekor -b v1.3.5 --depth 1
cd rekor
go build -o cmd/rekor-server/rekor-server cmd/rekor-server/main.go

What did you see happen?

# command-line-arguments
failed to find text symbol for HI20 relocation at 16198024 (f72988)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.morestack_noctxt
failed to find text symbol for HI20 relocation at 16198076 (f729bc)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to regexp.MustCompile
failed to find text symbol for HI20 relocation at 16198096 (f729d0)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.gcWriteBarrier2
failed to find text symbol for HI20 relocation at 16198128 (f729f0)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to github.com/aws/aws-sdk-go/aws/endpoints.map.init.0
failed to find text symbol for HI20 relocation at 16198136 (f729f8)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to github.com/aws/aws-sdk-go/aws/endpoints.init.func1
failed to find text symbol for HI20 relocation at 16198156 (f72a0c)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.gcWriteBarrier2
failed to find text symbol for HI20 relocation at 16198188 (f72a2c)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.makemap_small
failed to find text symbol for HI20 relocation at 16198228 (f72a54)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.duffzero
failed to find text symbol for HI20 relocation at 16198280 (f72a88)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.newobject
failed to find text symbol for HI20 relocation at 16198356 (f72ad4)
github.com/aws/aws-sdk-go/aws/endpoints.init: unsupported obj reloc 62 (R_RISCV_CALL)/8 to runtime.newobject
failed to find text symbol for HI20 relocation at 16198448 (f72b30)
/usr/lib/go/pkg/tool/linux_riscv64/link: too many errors

What did you expect to see?

Build successfully.
A successor of #62465 , but no the same issue.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.arch-riscvIssues solely affecting the riscv64 architecture.compiler/runtimeIssues related to the Go compiler and/or runtime.help wanted

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions