~$ cat /proc/$$/maps
08048000-080e9000 r-xp 00000000 03:01 619036     /bin/bash
080e9000-080ee000 rw-p 000a0000 03:01 619036     /bin/bash
080ee000-081cb000 rw-p 080ee000 00:00 0          [heap]
b7ced000-b7cf7000 r-xp 00000000 03:01 1694669
/lib/tls/i686/cmov/libnss_files-2.3.6.so
...................
b7f07000-b7f09000 rw-p b7f07000 00:00 0
b7f09000-b7f1e000 r-xp 00000000 03:01 720055     /lib/ld-2.3.6.so
b7f1e000-b7f20000 rw-p 00015000 03:01 720055     /lib/ld-2.3.6.so
bfbdc000-bfbf1000 rw-p bfbdc000 00:00 0          [stack]
ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]
~$ readelf -l /bin/bash

Elf file type is EXEC (Executable file)
Entry point 0x805be30
There are 8 program headers, starting at offset 52

Program Headers:
 Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
 PHDR           0x000034 0x08048034 0x08048034 0x00100 0x00100 R E 0x4
 INTERP         0x000134 0x08048134 0x08048134 0x00013 0x00013 R   0x1
     [Requesting program interpreter: /lib/ld-linux.so.2]
 LOAD           0x000000 0x08048000 0x08048000 0xa0200 0xa0200 R E 0x1000
 LOAD           0x0a0200 0x080e9200 0x080e9200 0x04b44 0x09728 RW  0x1000
 DYNAMIC        0x0a0214 0x080e9214 0x080e9214 0x000d8 0x000d8 RW  0x4
 NOTE           0x000148 0x08048148 0x08048148 0x00020 0x00020 R   0x4
 GNU_EH_FRAME   0x0a0138 0x080e8138 0x080e8138 0x0002c 0x0002c R   0x4
 GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
..............

Adresele (VirtAddr) sunt identice 08048000

08048000-080e9000 r-xp 00000000 03:01 619036     /bin/bash
LOAD           0x000000 0x08048000 0x08048000 0xa0200 0xa0200 R E 0x1000

Executabilele au prestabilita o adresa virtuala de incarcare  a
segmentului de cod, din momentul linkage-ului?



~$ readelf -l /bin/cat

Elf file type is EXEC (Executable file)
Entry point 0x8048bb0
There are 7 program headers, starting at offset 52

Program Headers:
 Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
 PHDR           0x000034 0x08048034 0x08048034 0x000e0 0x000e0 R E 0x4
 INTERP         0x000114 0x08048114 0x08048114 0x00013 0x00013 R   0x1
     [Requesting program interpreter: /lib/ld-linux.so.2]
 LOAD           0x000000 0x08048000 0x08048000 0x03bf4 0x03bf4 R E 0x1000
 LOAD           0x003bf4 0x0804cbf4 0x0804cbf4 0x001c8 0x00314 RW  0x1000
 DYNAMIC        0x003c08 0x0804cc08 0x0804cc08 0x000c8 0x000c8 RW  0x4
 NOTE           0x000128 0x08048128 0x08048128 0x00020 0x00020 R   0x4
 GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

~$ readelf -l /bin/cat
~$ cat &
[1] 30986
~$ cat  /proc/30986/maps
08048000-0804c000 r-xp 00000000 03:01 620002     /bin/cat
0804c000-0804d000 rw-p 00003000 03:01 620002     /bin/cat
0804d000-0806e000 rw-p 0804d000 00:00 0          [heap]
....................
b7f6f000-b7f84000 r-xp 00000000 03:01 720055     /lib/ld-2.3.6.so
b7f84000-b7f86000 rw-p 00015000 03:01 720055     /lib/ld-2.3.6.so
bf923000-bf938000 rw-p bf923000 00:00 0          [stack]
ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]

[1]+  Stopped                 cat

Aici VirtAddr 08048000

_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug

Raspunde prin e-mail lui