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

相關文章
相關標籤/搜索