linux下readelf程式簡介__linux

來源:互聯網
上載者:User

1、簡介

     readelf用來顯示一個或者多個elf格式的目標檔案的資訊,可以通過它的選項來控制顯示哪些資訊。


2、參數

     -a --all 顯示全部資訊,等價於 -h -l -S -s -r -d -V -A -I. 
     -h --file-header 顯示elf檔案開始的檔案頭資訊. 
     -l --program-headers  --segments 顯示程式頭(段頭)資訊(如果有的話)。 
     -S --section-headers  --sections 顯示節頭資訊(如果有的話)。 
     -g --section-groups 顯示節組資訊(如果有的話)。 
     -t --section-details 顯示節的詳細資料(-S的)。 
     -s --syms  --symbols 顯示符號表段中的項(如果有的話)。 
     -e --headers 顯示全部頭資訊,等價於: -h -l -S 
     -n --notes 顯示note段(核心注釋)的資訊。 
     -r --relocs 顯示可重定位段的資訊。 
     -u --unwind 顯示unwind段資訊。當前只支援IA64 ELF的unwind段資訊。 
     -d --dynamic 顯示動態段的資訊。 
     -V --version-info 顯示版本段的資訊。 
     -A --arch-specific 顯示CPU構架資訊。 
     -D --use-dynamic 使用動態段中的符號表顯示符號,而不是使用符號段。 
     -x <number or name> --hex-dump=<number or name> 以16進位方式顯示指定段內內容。number指定段表中段的索引,或字串指定檔案中的段名。 
     -w[liaprmfFsoR] or --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges] 顯示調試段中指定的內容。 
     -I --histogram 顯示符號的時候,顯示bucket list長度的柱狀圖。 
     -v --version 顯示readelf的版本資訊。 
     -H --help 顯示readelf所支援的命令列選項。 
     -W --wide 寬行輸出。 
     @file 可以將選項集中到一個檔案中,然後使用這個@file選項載入。 


3、樣本

1)顯示動態段資訊
     readelf -d <file_name>
     例如:
      readelf -d /bin/rm
     Dynamic section at offset 0x9420 contains 24 entries:
       Tag        Type                         Name/Value
      0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
      0x000000000000000c (INIT)               0x401470

     。。。。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.