objdump

-S,

如果有源程序的话,将源程序与汇编代码混合在一起。

使用该选项时,输入的目标文件需要有调试信息,即用gcc -g生成的目标文件才可以,因为,调试信息中才有源程序信息。

--adjust-vma=offset

对于a.out,似乎没有编码节的地址,因此,dump出来的节内容都是从0开始。用该方法可以将ram起始地址作为偏移,加到节内容地址上。

When dumping information, first add offset to all the section addresses. This is useful if the section addresses do not correspond to the symbol table, which can happen when putting sections at particular addresses when using a format which can not represent section addresses, such as a.out.

objcopy

-O bfdname

--output-target=bfdname

Write the output file using the object format bfdname. See Target Selection, for more information.

设置输出文件为bfdname格式。可以使用objdump -i查看支持的目标文件,如下,其中包括binary

sparc-elf-objdump -i
BFD header file version 2.13.2.1
elf32-sparc
(header big endian, data big endian)
sparc
a.out-sunos-big
(header big endian, data big endian)
sparc
elf32-little
(header little endian, data little endian)
sparc
elf32-big
(header big endian, data big endian)
sparc
srec
(header endianness unknown, data endianness unknown)
sparc
symbolsrec
(header endianness unknown, data endianness unknown)
sparc
tekhex
(header endianness unknown, data endianness unknown)
sparc
binary
(header endianness unknown, data endianness unknown)
sparc
ihex
(header endianness unknown, data endianness unknown)
sparc

该选项可以直接将text,data,bss段都拷贝出来,似乎不需要单独的拷贝各个段。

上面和下面三句效果一样?

sparc-elf-objcopy -O binary -j .text main.elf main.text
sparc-elf-objcopy -O binary -j .data main.elf main.data
sparc-elf-objcopy -O binary -j .bss main.elf main.bss

关于BFD

The BFD data files are related to GNU Binutils. BFD file is a Binary File Descriptor Data. The Binary File Descriptor library (BFD) is the GNU Project's main mechanism for the portable manipulation of object files in a variety of formats.

感觉应该是binutil需要支持许多目标文件格式(objdump -i可以查看支持的目标文件),如果由前端来匹配所有文件格式的话,那么前端会非常复杂。因此,弄了一个BFD,前端只和BFD打交道(相应的有一个BFD格式,internal canonical(简洁的) format),而由BFD和后端的各种目标文件格式打交道。这样,前端接口可以统一。这样增加某种目标文件格式支持也相对比较简单。

-j sectionpattern

--only-section=sectionpattern

只拷贝指定的节

Copy only the indicated sections from the input file to the output file. This option may be given more than once. Note that using this option inappropriately may make the output file unusable. Wildcard characters are accepted in sectionpattern.

If the first character of sectionpattern is the exclamation point (!) then matching sections will not be copied, even if earlier use of --only-section on the same command line would otherwise copy it. For example:

  --only-section=.text.* --only-section=!.text.foo

will copy all sectinos maching ’.text.*’ but not the section ’.text.foo’.

bin utilities related的更多相关文章

  1. OSCP Learning Notes - Privilege Escalation

    Privilege Escalation Download the Basic-pentesting vitualmation from the following website: https:// ...

  2. NCBI下载sra数据(新)

      今天要上NCBI下载sra数据发现没有下载的链接,网上查发现都是老的方法,NCBI页面已经变更,于是看了NCBI的help,并且记录下来新版的sra数据下载方法,要用NCBI的工具SRA Tool ...

  3. 使用ant优化android项目编译速度,提高工作效率

    1.Android项目编译周期长,编译项目命令取消困难 2.在进行Android项目的编译的同时,Eclipse锁定工作区不能进行修改操作 3.在只进行资源文件的修改时,Eclipse对资源文件的修改 ...

  4. OSCP Learning Notes - Capstone(1)

    Kioptrix Level 1.1 Walkthrough Preparation: Download the virtual machine  from the following website ...

  5. E-Business Suite 12.2 startCD 50 Install Fails with Fatal Error: TXK Install Service oracle.apps.fnd.txk.config.ProcessStateException: OUI process failed Cannot install Web Tier Utilities

    在rhel7.2上,使用startCD 50安装ebs r12.2的使用,安装到38%的时候就报错,遇到了和以下文章类似的问题: http://www.cnblogs.com/abclife/p/49 ...

  6. mysql workbench建表时PK,NN,UQ,BIN,UN,ZF,AI

    1. [intrinsic column flags] (基本字段类型标识) - PK: primary key (column is part of a pk) 主键 - NN: not null ...

  7. TPLink 备份文件bin文件解析[续]

    Most routers allow to save and restore configuration from files. This is cool because you can edit t ...

  8. Useful related java API for Android

    Language_suport and Other Language-Oriented API: strings,exceptions, threads, #java.lang.* offers th ...

  9. 一步一步制作yaffs/yaffs2根文件系统(二)---安装BusyBox,构造/bin、/sbin、/usr、linuxr

    开发环境:Ubuntu 12.04 开发板:mini2440  256M NandFlash   64M SDRAM 交叉编译器:arm-linux-gcc 4.4.3点此可下载 BusyBox版本: ...

随机推荐

  1. Flutter使用SingleTickerProviderStateMixin报错

    最近在学习开发Flutter应用项目,在创建tabbar和tabview后,进行网络请求后显示顶部tab标签,设置TabController,并使class类实现SingleTickerProvide ...

  2. CF - 高精度 + 贪心

    Last year Bob earned by selling memory sticks. During each of n days of his work one of the two foll ...

  3. Java入门 - 面向对象 - 07.包(package)

    原文地址:http://www.work100.net/training/java-package.html 更多教程:光束云 - 免费课程 包(package) 序号 文内章节 视频 1 概述 2 ...

  4. (树形DP入门题)Anniversary party(没有上司的舞会) HDU - 1520

    题意: 有个公司要举行一场晚会.为了让到会的每个人不受他的直接上司约束而能玩得开心,公司领导决定:如果邀请了某个人,那么一定不会再邀请他的直接的上司,但该人的上司的上司,上司的上司的上司等都可以邀请. ...

  5. Html中div块居中显示

    表面上这个问题很难,因为涉及到浏览器窗体大小,导致部分界面效果不一致.图中的方法适用于div块大小不变的界面. 如上所示,将其分为两块,margin-left和margin-top的值均分别为widt ...

  6. latex之在windows环境下能够在latex中使用中文

    今天要把前段时间的实验用英语先记录下来,自己就想根据原来会议的模版弄一个简易的页面(英语),突然想到之前用英文模板时是不能输入中文的,于是想着怎么在latex中输入中文,折腾了许久,终于成功了,现在分 ...

  7. xlwings excel(四)

    前言 当年看<别怕,Excel VBA其实很简单>相见恨晚,看了第一版电子版之后,买了纸质版,然后将其送人.而后,发现出了第二版,买之收藏.之后,发现Python这一编程语言,简直是逆天, ...

  8. Python+Excel 操作对比

    前言 从网页爬下来的大量数据需要excel清洗成堆的科学实验数据需要导入excel进行分析作为一名面向逼格的Python程序员该如何合理而又优雅的选择生产力工具呢? 得益于辛勤劳作的python大神们 ...

  9. 异想家Golang学习笔记

    1. 简介 官网:https://golang.google.cn/ 2. 编译器.工具链 编译 go build .\demo.go 编译和执行指令合二为一 go run demo.go 3. 注释 ...

  10. Python3-提高效率的方法

    1.字符串格式化 Python3.7或以上推荐使用f-string,其他版本推荐使用format方法. 2.字典的初始化 使用字面量初始化字典(以及其他集合类型). 说明:Python中初始化集合类型 ...