About libc-How main () is executed on Linux

Source: Internet
Author: User

Http://hi.baidu.com/heidycat/blog/item/f8fe3ba1c1026b8e46106472.html

In linux, the running process of a program is much more complex than I think. Even if a program does not contain any header files, after compilation, the target file contains the libc library. For example, in the MIPS system environment, compile the C program using the dynamic link library to obtain the corresponding target file. After the target file is decompiled, you will find section :. MIPS. stubs. This section is equivalent to the section in the IA32 system. plt: After tracking, stub jumped to libc. That is to say, the linker also loaded libc, although the programmer did not include any header files in the program.

What role does libc play? Currently, we have learned that libc initializes the _ start part of the process and manages the memory space of the process. This article makes it clear: How main () is executed on Linux.

P.S. I found this text on the Internet, which makes sense: "outside the kernel, It is a user-mode system library that provides the user program with System Call interfaces and some of the most commonly used routines, for example, new processes are generated, memory allocation and operation, and files are accessed. Since Linux is a UNIX-like operating system kernel, the system library is usually a C language library that complies with the Single Unix Specifications standard. By convention, this library is called libc. If you are familiar with C language program development, you will recognize that this is actually the Runtime Library of C Programs. That is to say, all programs developed in C language must be linked to this library ." (From http://www.cchere.net /)

 

 

 

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.