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/objdump: does not understand ARMv8 SHA-3 instructions #52098

Open
ericlagergren opened this issue Apr 1, 2022 · 8 comments
Open

cmd/objdump: does not understand ARMv8 SHA-3 instructions #52098

ericlagergren opened this issue Apr 1, 2022 · 8 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ericlagergren
Copy link
Contributor

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

$ go version
go version go1.18 darwin/arm64

Does this issue reproduce with the latest release?

This is the latest release.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN="/Users/eric/gopath/bin"
GOCACHE="/Users/eric/Library/Caches/go-build"
GOENV="/Users/eric/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/eric/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/eric/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/eric/git/arch/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2f/2_yz21b92h94_pvr2m00gzh80000gn/T/go-build4092429902=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran go tool objdump on a binary using SHA-3 instructions like XAR (VAXR) and EOR3 (VEOR3).

What did you expect to see?

It output valid Go (and GNU) assembly

What did you see instead?

?

@ericlagergren
Copy link
Contributor Author

ericlagergren commented Apr 1, 2022

I would send a CL but it looks like the tables were generated with a non-public tool, which is unfortunate.

@mengzhuo
Copy link
Contributor

mengzhuo commented Apr 1, 2022

cc @zhangfannie

@zhangfannie
Copy link
Contributor

I would send a CL but it looks like the tables were generated with a non-public tool, which is unfortunate.

The current go disassembler is not complete, and does not even support all ArmV8.0 instructions, including SHA-3 instructions of cource. And yes, this table is generated by a internal tool.

Can you use GNU objdump instead? Because we currently have no plans to perfect it. Thank you.

@ericlagergren
Copy link
Contributor Author

GNU objdump can't replace cmd/objdump because it does not output Go assembly.

Could ARM open source the tool? Otherwise, I am not sure how anybody could reasonably be expected to contribute to cmd/objdump.

@zhangfannie
Copy link
Contributor

Ok, I see. For your requirement, I I need to have a discussion within our group. Thank you.

@ericlagergren
Copy link
Contributor Author

@zhangfannie thank you.

@zhangfannie
Copy link
Contributor

@ericlagergren This tables.go is generated by one of our internal tools to parse internal architecture documents, but this tool can only parse internal armV8.0 documents, we currently do not have other good tools (public or internal) to parse non-armV8. 0 documentation to generate tables.go.

If you only add support for one or two instructions, we recommend that you follow the existing format and add it manually, and put it in a new file, such as tables_manual.go.

But if there are a lot of new instructions to support later, and at that time, we will consider rewriting a tool that can be exposed.

Thank you.

@ericlagergren
Copy link
Contributor Author

@zhangfannie thanks, that helps.

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 5, 2022
@cherrymui cherrymui added this to the Unplanned milestone Apr 5, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants