• Mike Frysinger's avatar
    nommu: add '[stack]' label to /proc/pid/maps output · 3c26c9d9
    Mike Frysinger authored
    Add support to the NOMMU /proc/pid/maps file to show which mapping is the stack
    of the original thread after execve.  This is largely based on the MMU code.
    Subsidiary thread stacks are not indicated.
    
    For FDPIC, we now get:
    
    	root:/> cat /proc/self/maps
    	02064000-02067ccc rw-p 0004d000 00:01 22         /bin/busybox
    	0206e000-0206f35c rw-p 00006000 00:01 295        /lib/ld-uClibc.so.0
    	025f0000-025f6f0c r-xs 00000000 00:01 295        /lib/ld-uClibc.so.0
    	02680000-026ba6b0 r-xs 00000000 00:01 297        /lib/libc.so.0
    	02700000-0274d384 r-xs 00000000 00:01 22         /bin/busybox
    	02816000-02817000 rw-p 00000000 00:00 0
    	02848000-0284c0d8 rw-p 00000000 00:00 0
    	02860000-02880000 rw-p 00000000 00:00 0          [stack]
    
    The semi-downside here is that for FLAT, we get:
    
    	root:/> cat /proc/155/maps
    	029f0000-029f9000 rwxp 00000000 00:00 0          [stack]
    
    The reason being that FLAT combines a whole lot of stuff into one map
    (including the stack).  But this isn't any worse than the current output
    (which is nothing), so screw it.
    Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Cc: Greg Ungerer <gerg@snapgear.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3c26c9d9
task_nommu.c 5.92 KB