A process (executing a program) consumes a certain amount of memory, either to store program code loaded from disk, or to store data from user input, and so on. However, the way the process manages these memory is different from memory usage, some of which are statically allocated and collected uniformly, while others are dynamically allocated and reclaimed as needed. For any ordinary process, it involves 5 different pieces of data.Five segments of a Linux processLet's briefly summarize what 5 d
Http://blog.chinaunix.net/uid-27018250-id-3867588.htmlBSS uninitialized global DataData already initialized globalText code snippet, machine instructionRodata string ConstantsReference: "Programmer self-accomplishment"Code compiled machine instructions are often placed in the code snippet, the code snippet is named ". Text"; The initialized global variable and the initialized local static variable are often placed in the data segment, the data segment is named ". Data", the uninitialized global
"Composition Ren say: ssk493" door Bss Hunjiang District sister find Real Service "No ☆ NEED ☆ SET ☆ Gold" "Composition Ren said: ssk493" [Bss Hunjiang District Hotel Real sister find true service "Composition Ren said: ssk493" [Bss Hunjiang area beautiful Beautiful service "Composition Ren said: ssk493" [ Bss Hunjiang
Initialization of the 12.BSS segmentIn C code: there is the initialization of the global data segment, the local stack, the malloc portion of the heap, the uninitialized global BSS segment.??The information compiled from the above is known:Starting address for BSS segment: 0001052CEnd of BSS segment address: 00010534Th
BSS segment:BSS segments are generally a memory area used to store uninitialized global variables in the program. BSS is short for block started by symbol. BSS segments belong to static memory allocation.
Data Segment:A data segment is a memory area used to store initialized global variables in a program. The data segment belongs to the static memory allocation.
These two days I watched the video of Jack Ma's instructor and mentioned the 10 thousand key in the video. I learned how to operate the memory in the program running. I mainly talked about the heap, stack, data, and it was a bit dizzy. I read it twice, so I can understand it a little bit.
Introduction
When the program is running, it is stored in the memory. It is divided into five parts based on static, member functions, code segments, objects, and so on.
1 Stack
2 heap
3
1. Uninitialized global variable (. BSS segment)The BSS segment is used to store global variables that have not been initialized and have been initialized to 0 . The following example code:#include Compile and view:$ gcc-g mainbss.c-o mainbss$ ls-l mainbss-rwxrwxr-x. 1 hy hy 8330 Apr 19:33 mainbss$ objdump-h mainbss |grep BSSMAINBSS: file format elf32-i386. BSS
Linux the segment management,BSS A segment (BSS segment) usually refers to an area of memory that is used to hold uninitialized global variables in the program. BSS is the abbreviation for English block Started by symbol. BSS segments belong to static memory allocations.This segment is used to store uninitialized globa
Before our startup file clears BSS and copies are implemented by the way of assembly, however, we are able to use the C language without using the assembler:First look at the connection script: sections{. = 0x30000000 ; __code_start =.; . = ALIGN (4 * (. Text)}. = ALIGN (4 * (. Rodata)}. = ALIGN (4 * = ALIGN (4 =.; . BSS: { * (. BSS)
Copyleft in this article belongs to the gfree.wind@gmail.com, the use of GPL release, can be freely copied, reproduced. However, please maintain the integrity of the document and indicate the original author and original link. It is strictly prohibited to use the document for any commercial purposes.By gfree.wind@gmail.comBlog: linuxfocus.blog.chinaunix.netRecently, I am reviewing the book "Programmer self-cultivation", because the level has improved compared with the previous one, so the readin
Different compiler may have slightly different allocations for storage during compilation, but the basic structure is roughly the same.Broadly, it can be divided into three segments: text, data, and BSS.The text section is used for storing code, which is typically mapped as read-only in memory, but data and BSS are writable.Data storage is usually divided into the following sections:1, stack: Automatically allocated by the compiler, save the function
BSS segments: In a segmented memory management architecture, BSS segments (BSS segments) are generally a memory area used to store uninitialized global variables in the program. BSS is short for block started by symbol. BSS segments belong to static memory allocation.
Data S
BSS:(BSS segment) usually refers to an area of memory that is used to store uninitialized global variables in the program. BSS is the abbreviation for English block Started by symbol. BSS segments belong to static memory allocations.Data Segment: Data segment usually refers to an area of memory that is used to hold the
BSS segment: (BSS segment) refers to a memory area used to store uninitialized global variables in the program. BSS is an English Block
Short for started by symbol. BSS segments belong to static memory allocation.
Data Segment: a data segment is usually a memory area used to store initialized global variables in the
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 progra
BSS segment in program, data segment, code snippet (. Text), heap (heap), stack (stack). BSS segment: Uninitialized and initialized to 0 global variables and static local variables (static) initialized to 0 in the program. Data segment: Non-zero initialized global variables and non-zero initialized static local variables (static) in the programCode Snippet: the place (. Text field) where the code is stored,
In memory management, memory is divided into: System reserve, code area, global variable area, heap, and stack.The global variable area can also be divided into: Data segment and BSS segment.The data segment is used to store initialized global variables, static variables, and literal constants.The BSS segment is used to store uninitialized global variables, static variables."Program Instance 1"#include usin
A program is generally divided into three sections: Text, data, and BSS. Text: it refers to the code of the program. It is determined during compilation, read-only, and data segment: data that can be determined at the compilation stage (rather than the runtime). readable and writable data is usually referred to as the static storage area. The global and static variables with initial values are stored in this area, constants are also stored in the
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.