Download ELF executable

On pages 2-7 and 2-8, the ELF file format specification has two pictures that give an example of an executable file, program headers and how they will be loaded into memory:

enter image description hereenter image description here

The specification states:

Although file file offsets and virtual addresses are congruent modulo 4 KB for text and data, up to four file pages hold unclean text or data (depending on page size and file system block size).

  • The first text page contains the ELF header, a table of program headers, and other information.
  • The last text page stores a copy of the beginning of the data.
  • The first page of data has a copy of the end of the text.
  • The last page of data may contain file information that is not relevant to the process being executed.

My questions:

  • i- " " " "?
  • 2- 3- ?
  • , , ?
  • , ( )?
+4
1

- . , . . 4096 0x1000 .

" " ; " " . , . , . 0- 0x8048000 0x8048fff, (0x8048100). 1- 0x8049000 0x8049fff. 0x8073000 0x8073fff, ( 0x8073eff).

0x8074000, 0x8074f00. , , , (PROT_EXEC|PROT_READ vs PROT_READ). , " " / " ".

, . "" "" , , . readelf objdump.

, ( "" ) , - .

, cat /proc/self/maps :

ben@joyplim ~ % cat /proc/self/maps
00400000-0040c000 r-xp 00000000 fe:01 36176026                           /bin/cat
0060b000-0060c000 r--p 0000b000 fe:01 36176026                           /bin/cat
0060c000-0060d000 rw-p 0000c000 fe:01 36176026                           /bin/cat
<plus the heap, stack, library, and special kernel stuff>
+3

All Articles