(C language Sample ) Compile procedure

mybwu_com發表於2014-01-06

Compile Flow chart (take C language as sample ):


Step 1: Pre Processor

Modify source file , e.g. #include <stdio.h>instruction need stdio.h file , Pre processor will

Read stdio.h and insert directly into source.c file .

Step 2: Compiler

Translate source file into assembly language . (.c -> .s)

Step 3: Assembler

Translate assembly language into machine languageinstruction which is a binary file. (.s->.o)

Step 4: Linker(multiple .o -> .exe)

Notice that ourhelloprogram calls theprintffunction, whichis part of the standard C library provided by every C compiler. The printffunction resides in a separate precompiled object file called printf.o, whichmust somehow be merged with our hello.o program. the linker handles this merge.

相關文章