查看: 1075|回复: 0
收起左侧

GNU Binutils

[复制链接]

  离线 

  • TA的每日心情
    拍拍
    2022-6-27 11:09
  • 签到天数: 25 天

    [LV.4]

    发表于 2020-10-22 20:33:05 | 显示全部楼层 |阅读模式

    有人预言,RISC-V或将是继Intel和Arm之后的第三大主流处理器体系。欢迎访问全球首家只专注于RISC-V单片机行业应用的中文网站

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    本帖最后由 sky 于 2020-10-22 20:36 编辑


    一、GNU Binutils
    The GNU Binutils are a collection of binary tools/utility. The main ones are:

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

    But they also include:

    • addr2line - Converts addresses into filenames and line numbers.
    • ar - A utility for creating, modifying and extracting from archives.
    • c++filt - Filter to demangle encoded C++ symbols.
    • 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 - Copies 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.

    Most of these programs use BFD, the Binary File Descriptor library, to do low-level manipulation. Many of them also use the opcodes library to assemble and disassemble machine instructions.

    The binutils have been ported to most major Unix variants as well as Wintel systems, and their main reason for existence is to give the GNU system (and GNU/Linux) the facility to compile and link programs.

    二、objdump

    objdump,可以用来将编译后的目标文件反汇编成汇编代码,对于研究学习编程语言(C/C++)有用。还有另外两个工具,名字叫“gdb”、“readelf”,有windows/Linux版本。

    objdump is a command-line program for displaying various information about object files on Unix-like operating systems. For instance, it can be used as a disassembler to view an executable in assembly form. It is part of the GNU Binutils for fine-grained control over executables and other binary data. objdump uses the BFD library to read the contents of object files. Similar utilities are Borland TDUMP, Microsoft DUMPBIN and readelf.

    Note that on certain platforms (e.g. Mac OS X), the objdump binary may actually be a link to llvm's objdump, with different command-line options and behavior.

    objdump [ -a | --archive-headers ]
            [ -b bfdname | --target=bfdname ]
            [ -d | --disassemble ]  [ -D | --disassemble-all ]
            [ -f | --file-headers ]
            [ -h | --section-headers | --headers ]  [ -i | --info ]
            [ -j section | --section=section ]
            [ -l | --line-numbers ]
            [ -m machine | --architecture=machine ]
            [ -r | --reloc ] [ -R | --dynamic-reloc ]
            [ -s | --full-contents ]  [ --stabs ]
            [ -t | --syms ] [ -T | --dynamic-syms ] [ -x | --all-headers ]
            [ --version ]  [ --help ] objfile...


    举例:

    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(1)

    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(2)

    查看汇编文本内容,这是intel的,也可以反汇编出针对 ARM MCU(Cortex-A8)的汇编指令:

    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(3)
    gdb:

    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(4)

    windows version

    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(5)

    三、GNU DDDWhat is DDD?

    GNU DDD is a graphical front-end for command-line debuggers such as GDB, DBX, WDB, Ladebug, JDB, XDB, the Perl debugger, the bash debugger bashdb, the GNU Make debugger remake, or the Python debugger pydb. Besides ``usual'' front-end features such as viewing source texts, DDD has become famous through its interactive graphical data display, where data structures are displayed as graphs.

    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(6)
    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(7)
    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(8)
    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(9)
    国外芯片技术交流-GNU Binutilsrisc-v单片机中文社区(10)

    For more information (and more screenshots), see the DDD Manual.





    上一篇:Linux 5.10已为基于EFI引导的RISC-V硬件提供了初步支持
    下一篇:1024程序员节,向改变世界的程序员致敬
    RISCV作者优文
    全球首家只专注于RISC-V单片机行业应用的中文网站
    回复

    使用道具 举报

    高级模式
    B Color Image Link Quote Code Smilies

    本版积分规则

    关闭

    RISC-V单片机中文网上一条 /2 下一条



    版权及免责声明|RISC-V单片机中文网 |网站地图

    GMT+8, 2024-3-29 09:13 , Processed in 0.723895 second(s), 47 queries .

    快速回复 返回顶部 返回列表