2.ELF之Section Header

SH架构

  1. elf.h

此处为每一个Section Entry的结构。函数

 

  1. 对应关系

foo.c字体

 

       foo.ospa

 

这里能够看到,SH从1168 = 0x490,每一个entry40B,23个entry,其中第20个是string section。debug

 

 

1.Name:  string table indexorm

 

 

.shstrtab中存储全部section 的名称(ASCII码存储),用“.”分隔。这样一来,每一个Section Entry中的name只须要存放该section的名称是从.shstrtab的第几个字符开始。字符串

2.Type:string

NULL             unusedit

PROGBITS      program dataio

NOBITS          program space with no data(bss)

REL                relocation entries, no addends

ARM_EXIDX    arm unwind section

ARM_ATTRIBUTES  arm attributes section

                     与具体架构ARM相关的section

STRTAB          string table,字符串表,变量名,函数名等。

SYMTAB         symbol table,符号表,变量,函数等。

3.Addr:   section virtual address at execution

              当前文件为.o REL 文件,未组装进可执行文件,因此没有虚拟地址与之对应。

4.Off:      section file offset

              此值从小到大能够看到section在当前文件中的排列顺序。

5.Size:     section size

6.ES:              entry size if section holds table

                   如若该section是一个table,table中每一个项目的大小是多大。好比Relocation Section中,8B正好是两个地址的大小,一个填充位置,一个填充数据(也是地址)。

7.Flg:       section flags

 

8.Lk:              link to another section

              此处为十进制表示,表示当前section依赖于某一section。

9.Inf:       additional section information

              若不为0,表示当前section是某一section的重定位section。

10.Al:      section alignment

 

Sections

  1. NULL
  2. text  代码
  3. data 数据
  4. bss   初始为0的数据
  5. ARM.extab             ARM exception数据
  6. ARM.exidx              ARM exception数据(详见exception)
  7. rel.ARM.exidx         上一section的重定位section

绿色字体为exception异常处理信息。

  1. debug_info            
  2. rel.debug_info
  3. debug_abbrev
  4. debug_aranges
  5. rel.debug_arranges
  6. debug_line
  7. rel.debug_line        
  8. debug_str

蓝色字体都为debug信息。

  1. comment

 

  1. note.GNU-stack

栈,大小为0;

  1. ARM.attributes
  2. debug_frame
  3. rel.debug_frame    
  4. shstrtab

section header string table

  1. symtab

symbol table

 

  1. strtab

string table

相关文章
相关标签/搜索