GNU Binutils工具


http://www.gnu.org/software/binutils/

http://sourceware.org/binutils/docs-2.23.1/

http://sourceware.org/binutils/docs-2.23.1/binutils/index.html

http://yunli.blog.51cto.com/831344/186727 (推薦)

http://wenku.baidu.com/view/fc8e70a1284ac850ad02424c.html

 

GNU Binutils是一套二進制工具集,提供了一系列用來創建、管理和維護二進制目標文件的工具程序。Binutils包括以下工具:

The GNU Binutils are a collection of binary tools. The main ones are:

  • ld - the GNU linker.
  • as - the GNU assembler.

But they also include:

  • addr2line - Converts addresses into filenames and line numbers.
  • (如果程序編譯的時候,添加了-g選項,該命令可以從符號表里面的地址找到對應的代碼行數信息)

[guest@host search_lau]$ dmesg |grep seg
is_searcher_ser[5701]: segfault at 0000000000000000 rip 00000000006a1425 rsp 0000000043c0ef10 error 4
is_searcher_ser[17723]: segfault at 0000000000000000 rip 00000000006a1425 rsp 0000000047196f10 error 4
[guest@host search_lau]$ addr2line  00000000006a1425 -e bin/is_searcher_server
/home/ascc_build1358835605903/b2b-isearch_cn/include/build/AttributeReader.h:118

  • ar - A utility for creating, modifying and extracting from archives.
  • c++filt - Filter to demangle encoded C++ symbols.

       (由於C++多態在編譯時對函數和變量的變化,造成閱讀上的不便,該命令可以方便的查看)

[admin@inc-search-p4p-150-46 ~]$ nm is_searcher_server |grep discover
000000000048c230 T _ZN5query14CIndexSearcher8discoverEPKcb
[admin@inc-search-p4p-150-46 ~]$ nm is_searcher_server |grep discover |xargs c++filt
000000000048c230
T
query::CIndexSearcher::discover(char const*, bool)

 

  • dlltool - Creates files for building and using DLLs.
  • gold - A new, faster, ELF only linker, still in beta test.
  • gprof - Displays profiling information.
  • nlmconv - Converts object code into an NLM.
  • nm - Lists symbols from object files.
  • objcopy - Copys and translates object files.
  • objdump - Displays information from object files.
  • ranlib - Generates an index to the contents of an archive.
  • readelf - Displays information from any ELF format object file.
  • size - Lists the section sizes of an object or archive file.
  • strings - Lists printable strings from files.
  • strip - Discards symbols.
  • windmc - A Windows compatible message compiler.
  • windres - A compiler for Windows resource files.

 

http://davidgao.github.io/LFSCN/chapter06/binutils.html

addr2line

將程序地址翻譯成文件名和行號;給定地址和可執行文件名稱,它使用其中的調試信息判斷與此地址有關聯的源文件和行號

ar

創建、修改和提取歸檔

as

一個匯編器,將 gcc 的輸出匯編為對象文件 into object files

c++filt

被鏈接器用於修復 C++ 和 Java 符號,防止重載的函數相互沖突

elfedit

更新 ELF 文件的 ELF 頭

gprof

顯示分析數據的調用圖表

ld

一個鏈接器,將幾個對象和歸檔文件組合成一個文件,重新定位它們的數據並且捆綁符號索引

ld.bfd

到 ld 的硬鏈接

nm

列出給定對象文件中出現的符號

objcopy

將一種對象文件翻譯成另一種

objdump

顯示有關給定對象文件的信息,包含指定顯示信息的選項;顯示的信息對編譯工具開發者很有用

ranlib

創建一個歸檔的內容索引並存儲在歸檔內;索引列出其成員中可重定位的對象文件定義的所有符號

readelf

顯示有關 ELF 二進制文件的信息

size

列出給定對象文件每個部分的尺寸和總尺寸

strings

對每個給定的文件輸出不短於指定長度 (默認為 4) 的所有可打印字符序列;對於對象文件默認只打印初始化和加載部分的字符串,否則掃描整個文件

strip

移除對象文件中的符號

libiberty

包含多個 GNU 程序會使用的途徑,包括 getoptobstackstrerrorstrtol 和 strtoul

libbfd

二進制文件描述器庫

libopcodes

一個庫,用於處理 opcodes——處理器指令的 “可讀文本” 版本;用於編制 objdump 這樣的工具


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM