Increasing the program break has the effect of allocating memory to the process; decreasing the break deallocates memory. Calling sbrk with an increment of 0 can be used to find the current location of the program break. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. What do brk and sbrk stand for?
Ask Question. Asked 10 years, 3 months ago. Active 1 year, 6 months ago. Viewed 5k times. Improve this question. Pirooz 1, 12 12 silver badges 23 23 bronze badges. Thomas Eding Thomas Eding Just do a 'man brk' and the meaning is clear from the description.
Because doing so makes the conversation harder to read. Why should I not top-post? Please do not top post. Rest of the message re-ordered. Have you read the article on exec-shield? It appears not Exec-shield attempts to randomize placement of the executable. Since the value of sbrk 0 at startup has a fixed relationship to the executable load address, exec-shield also randomizes the value returned by sbrk 0.
If the highlighed line is included in the program then brk value corresponds to the one of the addresses printed in the mappings If the highlighted line is removed in this program then brk value is some arbitrary value that doesnt exist in the address space mappings. This section stores the symbols that are uninitialized in text code and meta data needed to initialize the data at runtime.
In C, statically-allocated objects without an explicit initializer are initialized to zero for arithmetic types or a null pointer for pointer types. Implementations of C typically represent zero values and null pointer values using a bit pattern consisting solely of zero-valued bits though this is not required by the C standard. Unlike the data segment , actual value data is stored. BSS section only stores symbol and its size because its value will be zero initialized.
0コメント