gcc
can use an assembly file as input, and invoke the assembler as needed. There is a subtlety, though:
.s
" (lowercase 's'), then gcc
calls the assembler..S
" (uppercase 'S'), then gcc
applies the C preprocessor on the source file (i.e. it recognizes directives such as #if
and replaces macros), and then calls the assembler on the result.So, on a general basis, you want to do things like this:
gcc -S file.c -o file.s
gcc -c file.s