which cc
ll `which cc` # ll $(which cc) --> gcc
compile, run, inspect object files
gcc -c main.c -o main.o
gcc main.o -o main
objdump -h main.o # show section headers
objdump -x main.o # show all headers (including symbol table)
objdump -d main.o # disassemble code section (default is intel syntax)
objdump -d -M intel main.o # disassemble code section in intel syntax
ldd main # show shared library dependencies (not applicable for static binaries)
nm -C main.o # show symbol table (demangle C++ names with -C)
strings main.o # show printable strings in the binary (useful for debugging)
mcview main.o # show machine code in a more readable format (requires mcview tool)
cc -O1 -c main.c && objdump -d -M intel main.o # optimize
make
./main
# make clean
# make all
# make clean all