Differences between version 6 and predecessor to the previous major change of MemoryMap.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 6 | Last edited on Tuesday, March 9, 2004 5:39:43 pm | by PeterBuxton | Revert |
Older page: | version 3 | Last edited on Friday, November 28, 2003 6:02:02 pm | by JohnMcPherson | Revert |
@@ -1,18 +1,18 @@
The Linux Virtual Memory Map (as seen by a userspace program)
| __Starts at__ | __Contains__
| ffffffff |< End of the universe
+| ffffe000 |< vsyscall table (new in 2.5.x)
| c0000000 |< Off limits, reserved for the kernel
-| xxxxxxxx
|< Process stack (grows down)
+| bfffffff
|< Process stack (grows down)
| bffff000 |< Process heap (grows up)
| 40000000 |< Libraries
| zzzzzzzz |< Unused
-| yyyyyyyy |< __.bss__ segment, uninitialised program data
+| yyyyyyyy |< __.[
bss|BSS]
__ segment, uninitialised program data
| xxxxxxxx |< __.data__ segment, initialised program data
| 08048000 |< __.text__ segment, program code
-| 00000000 |< Unmapped to trap NULL pointers
-
+| 00000000 |< Unmapped to trap [
NULL]
pointers
!!Practical examples
!Library-mapped memory (using ldd(1))
$ ldd /bin/ls
@@ -44,7 +44,11 @@
$ cat > x3.c
#include <stdio.h>
#include <stdlib.h>
- int main(void) {char *p=malloc(3);printf("%p\n", p); return ;}
+ int main(void) {char *p=!
malloc(3);printf("%p\n", p); return ;}
$ gcc -o x3 x3.c && ./x3
0x8049628
+
+Also,
+ cat /proc/''pid''/maps
+gives you the memory map for a program :)