Executable programs include BSS segments, data segments, and code segments (also called text segments ). 1. bssbss (block started by symbol) is usually a memory area used to store uninitialized global variables and static variables in the program. Features: read/write, BSS segments are automatically cleared before the program is executed. Therefore, the uninitialized global variables are 0 before the program is executed. Note the difference from the data segment. BSS stores uninitialized global and static variables, and the data segment stores initialized global and static variables. In UNIX, you can use the SIZE command to view the segment size of the executable file. For example, size A. Out. 2. data segments are in a segmented memory management architecture. data segments are generally a memory area used to store initialized global variables in the program. The data segment belongs to the static memory allocation. Data segment, the code segment has been determined before the program runs. 3. Code segments in a segmented memory management architecture, code segments (code segment/Text Segment) are usually a memory area used to store code execution. The size of this area is determined before the program runs, and the memory area is usually read-only. Some architectures also allow code segments to be writable, that is, allow self-modified programs. In the code segment, it may also contain some read-only constant variables, such as string constants.
Executable programs include BSS segments, data segments, and code segments