5 Steps

Stage 1

gcc -E hello_world.c

Stage 2

gcc -S hello_world.c

Stage 3

  • Assembler generate Instruction in .o format
  • Essential for code sharing and dynamic linking in software development.
gcc -c hello_world.c

Stage 4

  • Linker Link up with other Instruction which are dependencies of the program we wrote
  • Sometimes we will break the program into many different c files, then run compiler on each, and link up all. This is for easier management & debugging
  • Output executable format or library file
  • We can use ldd to show the dependencies
  • Will return error if unable to link up some of the required .o files

Stage 5