"In-depth understanding of computer Systems" chapter Seventh study Summary

Source: Internet
Author: User


(一)
预处理器、编译器、汇编器和链接器
gcc命令编译运行C语言:
    1. Preprocessing phase: Converts the *.c file into a *.i pre-processed C program.

    2. Compile phase: Compiles the *.i file into the assembly code *.S file.

    3. Assembly phase: Converts the *.s file into a *.O binary target code file.

    4. Link stage: Convert the *.O file to an executable file.

    5. Generate executable file: Convert *.o to executable file.

    6. Executes executable C language files.

(ii) Target documents:three different forms:
    1. relocatable files (used to create the following two types of files with other object files) ——. o file
    2. Execute the file (indicating where the execution should begin)
    3. Shared files (mostly. So files, used by link editors and dynamic linker links)

(iii) Relocatable target files

Elf format

(iv) Static library links

(v) Executable target file

(vi) dynamic Link shared library

(vii) Tools for processing target documents

AR: Create a static library, insert, delete, list, and extract members. STRINGS: Lists all printable strings in a destination file. STRIP: Removes the information from the target file for the symbol. NM: Lists the symbols defined in the symbol table for a target file. Size: The name and size of the section in the destination file. Readelf: Displays the complete structure of a target file, including all information encoded in the ELF header. Contains the size and NM features. OBJDUMP: The mother of all binary tools, capable of displaying all the information in a target file. Its biggest function is disassembly. The binary instruction in the text section. LDD: Lists the shared libraries that are required by an executable file at run time.

"In-depth understanding of computer Systems" chapter Seventh study Summary

Related Article

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.