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: confusing disassembly of arm64 BL instruction #53117
Comments
Thanks for the report. In Go assembly (at least as input for the Go assembler), the |
Ah that makes sense now -- counting instruction offset is the same as (byte_offset >> 2). In that case I don't have a strong opinion anymore, but I agree that an absolute address would disambiguate. |
cc @golang/arm |
`go tool objdump` produces relative offsets for BL instructions as a number of instructions rather than a number of bytes. Calculate the byte offset ourselves. Example passing run on ARM machine: https://buildkite.com/gvisor/pipeline/builds/14732#018106ac-ac8e-4636-9a5a-bde1641b1175 Filed bug upstream about confusing output here: golang/go#53117 PiperOrigin-RevId: 451425266
`go tool objdump` produces relative offsets for BL instructions as a number of instructions rather than a number of bytes. Calculate the byte offset ourselves. Example passing run on ARM machine: https://buildkite.com/gvisor/pipeline/builds/14732#018106ac-ac8e-4636-9a5a-bde1641b1175 Filed bug upstream about confusing output here: golang/go#53117 PiperOrigin-RevId: 451425266
`go tool objdump` produces relative offsets for BL instructions as a number of instructions rather than a number of bytes. Calculate the byte offset ourselves. Example passing run on ARM machine: https://buildkite.com/gvisor/pipeline/builds/14732#018106ac-ac8e-4636-9a5a-bde1641b1175 Filed bug upstream about confusing output here: golang/go#53117 PiperOrigin-RevId: 452137751
What version of Go are you using (
go version
)?This also happens in bazel with go version 1.17.6.
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran
go tool objdump
on a binary.What did you expect to see?
There are many lines that look like:
However, the offset displayed should be -1653152. Objdump appears to be incorrectly parsing the offset from the instruction
0x97f9b198
.What did you see instead?
-413288. This is because the 2 trailing 0 bits described by the arm documentation appear not to be accounted for.
The text was updated successfully, but these errors were encountered: