What is compiler, linker, loader?

后端 未结 14 963
离开以前
离开以前 2020-12-07 06:48

I wanted to know in depth meaning and working of compiler, linker and loader. With reference to any language preferably c++.

14条回答
  •  温柔的废话
    2020-12-07 07:02

    Compiler:

    It will read source file which may be of type .c or .cpp etc and translates that to .o file called as object file.

    Linker:

    It combines the several .o files which may be generated for multiple source files into an executable file (ELF format in GCC). There are two type of linking:

    • static linking
    • dynamic linking

    Loader:

    A program which loads the executable file to the primary memory of the machine.


    For an in-detail study about the these three stages of program execution in Linux, please read this.

提交回复
热议问题