Abstract


Important

We usually use gcc which stands for GNU Compiler Collection, a program that handles the 5 steps program compilation for us.

gcc -Wall program.c tells the C compilers to give all possible warnings.

Stage 1

gcc -E hello_world.c

Stage 2

gcc -S hello_world.c

Stage 3

gcc -c hello_world.c
  • Assembler generate Instruction in .o format
  • Essential for code sharing and dynamic linking in software development
  • Is done by a program called as

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
  • Is done by a program called ld

Stage 5

References