Linker & loader Reading Notes

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.