Sorav said:
Is there a way to print out all the operations performed in a gcc call:
eg. gcc foo.c -o foo
perhaps performs
foo.c --> foo.s (using compiler)
foo.s --> foo.o (using assembler as)
foo.o --> foo (using linker ld)
I am interested in the options gcc used
when assembling and linking at the intermediate steps.
Try the gnu.gcc.help newsgroup.
gcc -v -Wall -std=c99 -pedantic -o main main.c
Reading specs from \
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ../gcc-3.4.1.src/configure
Thread model: posix
gcc version 3.4.1
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 \
-quiet -v main.c -quiet -dumpbase main.c -mtune=pentiumpro \
-auxbase main -Wall -pedantic -std=c99 -version \
-o /tmp/ccKyMHYc.s
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/include
/usr/include
End of search list.
GNU C version 3.4.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.4.1.
GGC heuristics: --param ggc-min-expand=64 \
--param ggc-min-heapsize=64329
as -V -Qy -o /tmp/ccQvmn4g.o /tmp/ccKyMHYc.s
GNU assembler version 2.15.90.0.3 (i386-redhat-linux) \
using BFD version 2.15.90.0.3 20040415
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.1/collect2 \
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 \
-o main /usr/lib/crt1.o /usr/lib/crti.o \
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/crtbegin.o \
-L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1 \
-L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/../../.. \
/tmp/ccQvmn4g.o -lgcc --as-needed -lgcc_s --no-as-needed \
-lc -lgcc --as-needed -lgcc_s --no-as-needed \
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/crtend.o \
/usr/lib/crtn.o