Data segment during execution of program

Doubt:

If we execute a program, the following is the type of memory allocated to that program.

                                            __________________
                                            |                |
                                            |      stack     |
                                            |                |
                                            ------------------
                                            |                |
                                            |   <Un Allocated|
                                            |       space>   |
                                            ------------------
                                            |                |
                                            |                |
                                            |       Heap     |
                                            |                |
                                            |                |
                                            __________________
                                            |                |
                                            |       data     |
                                            __________________
                                            |       text     |
                                            __________________

here the data segment places a vital role. All the initialized data and the uninitialized datas are present in data segment. But, I did not know about the order of storing the data in the data segment. For Ex, the initialized data, uninitialized data, read only and the read write data. I think the above are the four types are present in data segment.

so, in which order the data’s will be placed in data segment. Like first intialized data which have the address less than all. And the next is uninitialized data’s which have the higher address than the initialized data’s like that.

Thanks in Advance.


Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.