What is the memory region ?

Jacky jackyclivia at 163.com
Thu Mar 7 05:01:13 EST 2013


Dear all,

This is the Program Header for "cat" info:

================================
readelf -l /bin/cat
...
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x08048034 0x08048034 0x00120 0x00120 R E 0x4
  INTERP         0x000154 0x08048154 0x08048154 0x00013 0x00013 R   0x1
      [Requesting program interpreter: /lib/ld-linux.so.2]
  LOAD           0x000000 0x08048000 0x08048000 0x0a00c 0x0a00c R E 0x1000
  LOAD           0x00af04 0x08053f04 0x08053f04 0x00258 0x00820 RW  0x1000
  DYNAMIC        0x00af10 0x08053f10 0x08053f10 0x000e8 0x000e8 RW  0x4
  NOTE           0x000168 0x08048168 0x08048168 0x00044 0x00044 R   0x4
  GNU_EH_FRAME   0x009008 0x08051008 0x08051008 0x002d4 0x002d4 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
  GNU_RELRO      0x00af04 0x08053f04 0x08053f04 0x000fc 0x000fc R   0x1
==============================

So there are just 2 PT_LOAD segments. But why kernel maps 3 memory regions ? The following is the maps output:

============================
cat /proc/self/maps

08048000-08053000 r-xp 00000000 08:01 261656     /bin/cat
08053000-08054000 r--p 0000a000 08:01 261656     /bin/cat
08054000-08055000 rw-p 0000b000 08:01 261656     /bin/cat
09b58000-09b79000 rw-p 00000000 00:00 0          [heap]
b75bd000-b75be000 rw-p 00000000 00:00 0
b75be000-b7761000 r-xp 00000000 08:01 523958     /lib/i386-linux-gnu/libc-2.15.so
...
==================

The above output, there are 3 memory regions for "/bin/cat", and what is the following segment:

08053000-08054000 r--p 0000a000 08:01 261656     /bin/cat

According the 'cat' program header, there is no "r" segment.


Regards,
Jacky


 






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130307/bb5feb0c/attachment.html 


More information about the Kernelnewbies mailing list