gcc -S

0001-01-01

The -S flag in GCC compiles C or C++ code into assembly language without creating a final executable file.

Example:

gcc -S foo.c

This outputs the assembler result of ‘foo.c’ into ‘foo.s’

adding the -fverbose-asm flag will add comments to the resulting assembler output, making it easier to follow along and understand.


Links to this note