Next | Prev | Up | Top | Contents | Index
Address Space Boundaries
A process has at least three segments of usable addresses:
- A text segment contains the executable image of the program. Another text segment is created for each dynamic shared object (DSO) with which a process is linked.Text segments are always read-only.
- A data segment contains the "heap" of dynamically allocated data space. A process can create additional data segments in various ways described later.
- A stack segment contains the function-call stack. The segment is extended automatically as needed.
Although the address space begins at location 0, by convention the lowest segment is allocated at 0x0040 0000 (4 MB). Addresses less than this are left undefined so that an attempt to reference them (for example, through an uninitialized pointer variable) causes a hardware exception.
Typically, the text segments are at smaller virtual addresses and stack and data segments at larger ones, although you should not write code that depends on this.
Tip: The boundaries of all distributed DSOs are declared in the file /usr/lib/so_locations. When IRIX loads a DSO that is not declared in this file, it seeks a segment of the address space that does not overlap any declared DSO and that will not interfere with growth of the stack segment.
Next | Prev | Up | Top | Contents | Index