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: always assume 64 bit mode even if it is 32 bit for x86 CPU #22093
Comments
@hirochachacha
|
@dougpuob yes, so, what conclusion are you implying? Assuming 64-bit execution mode for the binary that is created for 32 bit CPU is right? |
@hirochachacha
See the return data type of Decode() function is
|
@dougpuob So, what's your conclusion? |
Hi @hirochachacha. I think it is not about assuming 64-bit or 32-bit execution mode, input array is 64-bit data and you indicate 64, then function return a 64-bit instruction, so and 32-bit. My conclusion is the function returns what you told him, didn't assume. If my conception is incorrect please let me know. |
It certainly sounds like a bug. Does it actually mis-disassemble anything though? |
z.go package main
import "fmt"
func main() {
fmt.Print("Hello World!")
} patch
diff (before patch - after patch for z.o which is created by
It looks like this is a root cause of #19988. |
I'm saying that |
Yes, that looks like using arch instead of 64 in disasm_x86 is correct. |
Sure. |
Change https://golang.org/cl/67450 mentions this issue: |
See following code.
go/src/cmd/internal/objfile/disasm.go
Lines 298 to 317 in ee4fbbc
disasm_386
anddisasm_amd64
pass its own CPU mode todisasm_x86
, howeverdisasm_x86
always use the hard coded value64
.I'm not familiar with CPUs, so I cannot provide minimal example. But this is probably a bug.
The text was updated successfully, but these errors were encountered: