I recently read the book linker & loader and sorted out some of my doubts.
1. Differences between compilers and compilers: there is no relationship between the two
Compiler: generate an intermediate source file (such as C)Code, Assembly or machine code.
Assembler: generate the machine code from the source code of the assembly language.
However, there is a synergy between the compiler and the assembler, for example, processing C source file:
C language Preprocessor processes a and generates
C language compilation and preprocessing of A, generate Assembly file
The assembler processes Assembly file a and generates the target file.
2. automatically link to the standard library
N example: G ++-O hello. cpp, compiled hello. cpp as executable
File hello, automatically connect to the Standard C ++ library libstdc ++. So
N example: gcc-O hello. C. Compile hello. C as an executable file.
Hello (automatically connect to the Standard C library libc. So)
3. compiler, assembler, linker, and loader
The compiler and assembler create the target file (includingProgramGenerated binary code and data ). Linker
Merge multiple target files into one. The loader reads these target files and loads them into the memory.
What is an example of a Linux Loader? I personally think it is shell.