PDA

View Full Version : g++/gcc show assembler code



c0mput3r_n3rD
February 6th, 2010, 03:32 AM
Hello all,

I'm just wondering if any of you know how to view the assembler code after compiling C++ code with g++/gcc. I can't find information on this any where.

Thanks.

baddog144
February 6th, 2010, 07:14 AM
gcc -S foo.c

Note the -S

c0mput3r_n3rD
February 6th, 2010, 07:54 AM
You made my night. Thank you!

baddog144
February 6th, 2010, 08:23 AM
Hey, no problem :)

MadCow108
February 6th, 2010, 06:42 PM
you can also use objdump -dS on the compiled binary

c0mput3r_n3rD
February 6th, 2010, 11:18 PM
Thanks madcow that's pretty cool.