The structure of the executable program;
1. First, we know that programming is the logic of writing data and processing data.
2. After an application is compiled, the executable file is divided into: Code area, constant area double-click the program, the host system will have an application loader software. The program loads the application into memory. When the memory is loaded, the global variables, constants, and other data in the program begin to load.
3. Memory divided into: Code area (segment), constant area (segment), BSS segment, heap area, stack area
4. The code area stores the code corresponding to the machine instructions
5. The constant area stores all the constants in the program
6.BSS segment, used to store the value of a global variable
7. Storage of dynamic memory managed by the user in the heap, this memory is completely managed by the user
8. The stack area is the memory that is maintained by the operating system, and each function will request a certain amount of memory to the operating system before it is run, and then the function can be executed, and the memory freed.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The structure of an executable program