objcopy
objcopy
objcopy [options] infile [outfile]
Copy the contents of the input object file to another file, optionally changing the file format in the process (but not the endian-ness). If outfile is not specified, objcopy creates a temporary file and renames it to infile when the copy is complete, destroying the original input file. The GNU Binary File Descriptor (BFD) library is used to read and write the object files.
Options
--add-section section=file
Add a new section to the output object file with the specified section name and the contents taken from the specified file. Available only for formats that allow arbitrarily named sections.
--alt-machine-code=n
If the output architecture has alternate machine codes, use the nth code instead of the default.
-b n, --byte=n
Copy only every nth byte. Header data is not affected. The value of n can be from 0 to interleave-1, where interleave is specified by -i(default is 4). This option is useful for creating files to program ROM and is typically used with srec as the output format.
-B bfdarch, --binary-architecture=bfdarch
Set the output architecture to bfdarch (e.g., i386) for transforming a raw binary file into an object file. Otherwise, this option is ignored. After the conversion, your program can access data inside the created object file by referencing the special symbols _binary_objfile_start,_binary_objfile_end, and _binary_objfile_size.
--change-addresses=incr, --adjust-vma=incr
Change the VMA and LMA addresses of all sections, plus the start address, by adding incr. Changing section addresses is not supported by all object formats. Sections are not relocated.
--change-leading-char
For object formats that use a special character (such as an underscore) to begin symbols, change the leading character when converting between formats. If the character is the same in both formats, the option has no effect. Otherwise, it adds, removes, or changes the leading character as appropriate for the output format.
--change-section-address section{=|+|-}val,--adjust-section-vma section{=|+|-}val
Set or change the VMA and LMA addresses of the specified section. With =, set the section address to the specified value; otherwise, add or subtract the value to get the new address.
--change-section-lma section{=|+|-}val
Set or change the LMA address of the specified section. With =, set the section address to the specified value; otherwise, add or subtract the value to get the new address.
--change-section-vma section{=|+|-}val
Set or change the VMA address of the specified section. With =, set the section address to the specified value; otherwise, add or subtract the value to get the new address.
--change-start incr, --adjust-start incr
Add incr to the start address to get a new start address. Not supported by all object formats.
--change-warnings, --adjust-warnings
Issue a warning if the section that is specified in one of the options --change-section-address, --change-section-lma, or --change-section-vma does not exist.
--debugging
Convert debugging information if possible.
-F bfdname, --target=bfdname
Set the binary format for both input and output files to the binary file descriptor name bfdname. No format translation is done. Use the -hoption for a list of supported formats for your system.
-g, --strip-debug
Do not copy debugging information.
-G symbol, --keep-global-symbol=symbol
Copy only the specified global symbol, making all other symbols local to the file. May be specified multiple times.
--gap-fill=val
Fill gaps between sections with the specified value; applies to the load address (LMA) of the sections.
-h, --help
Print help information, including a list of supported target object formats, then exit.
-i interleave, --interleave=interleave
Copy one out of every interleave bytes. Use -b to set the byte to copy (default is 4). This option is ignored if -b is not specified.
-I bfdname, --input-target=bfdname
Set the binary file format of the input file using its binary file descriptor name, bfdname.
-j section, --only-section=section
Copy only the specified section. May be specified multiple times.
-K symbol, --keep-symbol=symbol
Copy only the specified symbol from the source file. May be specified multiple times.
--keep-global-symbols=filename
Apply the option --keep-global-symbol to each symbol listed in the specified file. The file should have one symbol per line, with comments beginning with a hash mark (#). May be specified multiple times.
--keep-symbols=file
Apply the option --keep-symbol to each symbol listed in the specified file. The file should have one symbol per line, with comments beginning with a hash mark (#). May be specified multiple times.
-L symbol, --localize-symbol=symbol
Make the specified symbol local. May be specified multiple times.
--localize-symbols=filename
Apply the option --localize-symbol to each symbol listed in the specified file. The file should have one symbol per line, with comments beginning with a hash mark (#). May be specified multiple times.
-N symbol, --strip-symbol=symbol
Do not copy the specified symbol. May be specified multiple times.
--no-change-warnings, --no-adjust-warnings
Do not issue a warning even if the section specified in one of the options --change-section-address, --change-section-lma, or --change-section-vma does not exist.
-O bfdname, --output-target=bfdname
Set the binary file format of the output file using its binary file descriptor name, bfdname. The format srec generates S-records (printable ASCII versions of object files), and binary generates a raw binary file. Use -h for other available formats.
-p, --preserve-dates
Preserve the input file's access and modification dates in the output file.
--pad-to=addr
Pad the output file up to the load address. Use the fill value specified by --gap-fill (default is 0).
-R section, --remove-section=section
Do not copy any section with the specified name. May be specified multiple times.
--redefine-sym old=new
Change the name of the symbol old to new.
--remove-leading-char
If the first character of a global symbol is a special character (such as an underscore) used by the input object file format, remove it. Unlike--change-leading-char, this option always changes the symbol name when appropriate, regardless of the output object format.
--rename-section oldname=newname[,flags]
Rename a section from oldname to newname, optionally also changing the flags to flags.
-S, --strip-all
Do not copy relocation and symbol information.
--set-section-flags section=flags
Set flags for the specified section as a comma-separated string of flag names. Not all flags are meaningful for all object formats. The possible flags are alloc, code, contents, data, debug, load, noload, readonly, rom, and share.
--set-start=val
Set the start address of the new file to the specified value. Not supported by all object formats.
--srec-forceS3
Force all srec output records to be type S3 records.
--srec-len=ival
Set the maximum length of srec output records to the specified value. The length includes the address, data, and crc fields.
--strip-symbols=filename
Apply the option --strip-symbol to each symbol listed in the specified file. The file should have one symbol per line, with comments beginning with a hash mark (#). May be specified multiple times.
--strip-unneeded
Strip all symbols not needed for relocation processing.
-v, --verbose
Run in verbose mode, listing all object files modified; for archives, list all archive members.
-V, --version
Print version information and exit.
-W symbol, --weaken-symbol=symbol
Make the specified symbol weak. May be specified multiple times.
--weaken
Make all global symbols weak.
--weaken-symbols=filename
Apply the option --weaken-symbol to each symbol listed in the specified file. The file should have one symbol per line, with comments beginning with a hash mark (#). May be specified multiple times.
-x, --discard-all
Do not copy nonglobal symbols.
-X, --discard-locals
Do not copy compiler-generated local symbols (usually those starting with L or ..).
objcopy的更多相关文章
- Linux objcopy命令
一.简介 [功能] 将目标文件的一部分或者全部内容拷贝到另外一个目标文件中,或者实现目标文件的格式转换. [描述] objcopy工具使用BFD库读写目标文件,它可以将一个目标文件的内容拷贝到另外一个 ...
- 使用objdump objcopy查看与修改符号表
使用objdump objcopy查看与修改符号表动态库Linuxgccfunction 我们在 Linux 下运行一个程序,有时会无法启动,报缺少某某库.这时需要查看可执行程序或者动态库中的符 ...
- GNU 下命令objcopy 用法
概念: 将目标文件的一部分或者全部内容拷贝到另外一个目标文件中,或者实现目标文件的格式转换. 常用转换: 1 把elf格式转成s19格式: objcopy --srec-len --srec-forc ...
- GCC编译器原理(一)04------GCC 工具:nlmconv、nm、objcopy、objdump和 ranlib
1.3.13 nlmconv nlmconv 将可重定位的对象文件(Infile)转换为 NetWare 可加载模块(outfile),并可选择读取头文件信息获取 NLM 头信息. 选项,描述 -I ...
- arm-linux-gcc/ld/objcopy/objdump参数总结【转】
arm-linux-gcc/ld/objcopy/objdump参数总结 转自:http://blog.csdn.net/muyuyuzhong/article/details/7755291 arm ...
- (笔记)arm-linux-gcc/ld/objcopy/objdump参数总结
说明:gcc是编译器,负责对c代码的编译, ld是连接器 负责将多个*.o的目标文件链接成elf可执行文件.elf可执行文件是unix常用的可执行文件类型,就像windows的exe文件.elf文件中 ...
- binutils工具集之---objcopy,ranlib,size,strings,strip
objcopy的作用是拷贝一个目标文件的内容到另一个目标文件中.objcopy使用GNU BFD库去读或写目标文件.objcopy可以使用不同于源目标文件的格式来写目的目标文件(也即是说可以将一种格式 ...
- Linux 程式減肥(strip & objcopy)(转载)
转自:http://calamaryshop.blogspot.com/2011/11/linux-strip-objcopy.html 對於設計嵌入式Linux系統的研發人員來說,記憶體的空間是非常 ...
- 使用objcopy实现将文件编译进执行程序
一.简介 工作中可能遇到将一个文件编译进执行程序的需求,例如bin文件.jpg文件等等.实现的方法可以使用脚本来将文件内容写入一个新的C源文件数组,达成编译进程序的目的. 现在介绍一种简单.快捷的方 ...
随机推荐
- Access
一般系统的实现: 管理系统的分析与设计 --->>数据表的设计创建 --->> 设计“查询”与“宏” --->> 创建窗体与报表 --->>系统注册 启 ...
- iOS中 @synthesize 和 @dynamic
今天写点过时的东西,我记得 这个是xcode 4 那个年代的事情了,没想到有时候大家还会被问到.可能目的就是看看你是从是么时候才开始接触iOS的. 在声明property属性后,有2种实现选择 @s ...
- SignalR发布后不能生成signalr/hubs
问题:代码写完后,在一台服务器上运行没有问题.换到另外一台服务器上,找不到signalr/hubs,显示404错误. SignalR版本:2.0.3 VS版本:2013 服务器:Windows Ser ...
- 【BZOJ】【2463】【中山市选2009】谁能赢呢?
博弈论 这能算博弈论吗…… orz ZYF so sad……窝智商太低 题解搬运: 当n为偶数时,可以被2*1的骨牌完全覆盖,所以每次都走骨牌的另一端,而另一个人只能走新的骨牌,直到没有为止 当n为奇 ...
- WP 类似扑克牌布局控件和类似扑克卡片控件
一.说明 本文代码来源: <windows phone 7 程序设计> Charles Petzold 控件效果: 二.要点: 1.ItemControl.子项容器模板(ItemsCont ...
- uva 11174
刘书上例题 #include <cstdio> #include <cstdlib> #include <cmath> #include <map> # ...
- Hibernate3中将指定的HQL语句转换成SQL语句
import org.hibernate.engine.SessionFactoryImplementor; import org.hibernate.hql.ast.QueryTranslatorI ...
- Intent (一)
1,简介 Intent 是一种消息传递机制,可以理解为一种对消息的封装,执行某操作的抽象描述,可用于应用程序内部及应用程序之间 其组成包括: 要执行的动作(action) 如VIEW_ACTION(查 ...
- 2013 Multi-University Training Contest 1 3-idiots
解题报告: 记录 A_i 为长度为 i 的树枝的数量,并让 A 对它本身做 FFT,得到任意选两个树枝能得到的各个和的数量.枚举第三边, 计算出所有两边之和大于第三条边的方案数,并把前两条边包含最长边 ...
- 使用getScript()方法异步加载并执行js文件
使用getScript()方法异步加载并执行js文件 使用getScript()方法异步请求并执行服务器中的JavaScript格式的文件,它的调用格式如下所示: jQuery.getScript(u ...