-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/objdump: should be able to disassemble Go .o files #13862
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
Comments
Inspected the code a bit. The error comes from
These are used (via rawFile interface) in Disasm(). The common disassemble code expects a single table and a single slice of text, and operate on that. But these are not directly available in goobj files. What would be the direction to go here: change Disasm side to be able to consume data in a more flexible way, or collect and construct data in goobj.go to fulfill the existing interfaces (e.g. build a gosym.Table)? Or neither? /cc @rsc (since he reworked a bit Disasm back then, might have opinion) |
I've landed on this issue because I'm trying to do the same thing (disassemble a |
@jacobsa There is no direct workaround as far as I know. One approach is to use the compiler's -S option. Or, of course, link the program and use the system objdump tool. |
Thanks. I was looking for pre-link output, so |
See https://go-review.googlesource.com/c/22685/ for a quick, bad pass at this. |
CL https://golang.org/cl/24818 mentions this issue. |
$go tool compile fib.go
$go tool objdump fib.o
objdump: disassemble fib.o: pcln not available in go object file
It would be nice if this worked. The pcln info is in there somewhere.
"go tool nm fib.o" works.
The text was updated successfully, but these errors were encountered: