Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upcmd/objdump: add -gnu flag to use GNU/AT&T syntax in disassembly #34372
Comments
This comment has been minimized.
This comment has been minimized.
It seems a little awkward to print two copies of the assembly by default. Would it make sense to have a |
This comment has been minimized.
This comment has been minimized.
An option would be great. I wasn't sure on the policy of adding new options to Go's objdump tool. |
This comment has been minimized.
This comment has been minimized.
I'm completely fine with a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have had a patch to do this for quite a while on ppc64 which I've provided to internal and external developers who want to write Go assembler to optimize their code. I tried to sneak it in a while back for ppc64 but Cherry suggested I make it a proposal.
The initial goal was to make it easier for Go developers who write Go assembler to verify they are getting the native assembler they expect. Many are experts in their native assembler but not in Go assembler. With this change, the Go objdump will show both side by side. This is also helpful for any code compiled with Golang. The gnu objdump can be used to disassemble Go binaries but not all objects created by Go are accepted.
This could be controlled by option but that is probably too much bother, unless there are concerns about doing this all the time.
It can be added easily for ppc64 and others assuming GNUSyntax works well. I tried it for x86 but since I'm not fluent there I can't verify if the output looks like it should.
Here is an example of the output: