ELF文件整体格式小结

因为elf格式中不同的section,不同的segment有不同的作用。这里只是注重整体ELF的作用,具体详细的用到了再看。

1  Elf files have a dual nature:

  • Compilers, assemblers, and linkers treat the file as a set of logical sections described by a section header table.
  • The system loader treats the file as a set of segments described by a program header table.

2 Elf defines the format of executable binary files. There are four different types:

  • Relocatable ---- Created by compilers or assemblers. Need to be processed by the linker before running.
  • Executable ---- Have all relocation done and all symbol resolved except perhaps shared library symbols that must be resolved at run time.
  • Shared object ---- Shared library containing both symbol information for the linker and directly runnable code for run time.
  • Core file ---- A core dump file.

格式为:

elf header------
segment table---------
sections/segments--------(一般一个segment可以包括n个section)
section table

具体细节可以使用objdump 或者 readelf命令查看。

更加细节的内容可以查看unit elf PPT.

posted @ 2011-10-09 23:45  Jack204  阅读(204)  评论(0编辑  收藏  举报