-
objdump
2020-12-29 07:15:41/home/qdb/hdfi-master/hdfi-master/install/riscv64-unknown-linux-gnu/bin/objdump' -S '/home/qdb/hdfi-master/hdfi-master/toolchain/gcc/build_linux/build-glibc-linux64/libc.so.6' <p>Hello, I... -
Objdump
2013-09-27 10:11:27gcc命令objdump用法 ...gcc命令之 objdump ...---------------objdump是用查看目标文件或者可执行的目标文件的构成的GCC工具---------- 以下3条命令足够那些喜欢探索目标文件与源代码之间的丝丝的关系的http://hi.baidu.com/gbhhlfmksebnqwq/item/57a8b808467560c72e4c6b9b
gcc命令objdump用法
gcc命令之 objdump
---------------objdump是用查看目标文件或者可执行的目标文件的构成的GCC工具----------
以下3条命令足够那些喜欢探索目标文件与源代码之间的丝丝的关系的朋友。
objdump -x obj 以某种分类信息的形式把目标文件的数据组织(被分为几大块)输出 <可查到该文件的所有动态库>
objdump -t obj 输出目标文件的符号表()
objdump -h obj 输出目标文件的所有段概括()
objdump -j .text/.data -S obj 输出指定段的信息,大概就是反汇编源代码把
objdump -S obj C语言与汇编语言同时显示
以下为网上摘录文章。
关于nm -s的显示请自己man nm查看
objdump命令的man手册
objdump - 显示二进制文件信息
objdump
[-a] [-b bfdname |
--target=bfdname] [-C] [--debugging]
[-d] [-D]
[--disassemble-zeroes]
[-EB|-EL|--endian={big|little}] [-f]
[-h] [-i|--info]
[-j section | --section=section]
[-l] [-m machine ] [--prefix-addresses]
[-r] [-R]
[-s|--full-contents] [-S|--source]
[--[no-]show-raw-insn] [--stabs] [-t]
[-T] [-x]
[--start-address=address] [--stop-address=address]
[--adjust-vma=offset] [--version] [--help]
objfile...--archive-headers
-a 显示档案库的成员信息,与 ar tv 类似
objdump -a libpcap.a
和 ar -tv libpcap.a 显示结果比较比较
显然这个选项没有什么意思。
--adjust-vma=offset
When dumping information, first add offset to all
the section addresses. This is useful if the sec-
tion 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.
-b bfdname
--target=bfdname
指定目标码格式。这不是必须的,objdump能自动识别许多格式,
比如:objdump -b oasys -m vax -h fu.o
显示fu.o的头部摘要信息,明确指出该文件是Vax系统下用Oasys
编译器生成的目标文件。objdump -i将给出这里可以指定的
目标码格式列表
--demangle
-C 将底层的符号名解码成用户级名字,除了去掉所有开头
的下划线之外,还使得C++函数名以可理解的方式显示出来。
--debugging
显示调试信息。企图解析保存在文件中的调试信息并以C语言
的语法显示出来。仅仅支持某些类型的调试信息。
--disassemble
-d 反汇编那些应该还有指令机器码的section
--disassemble-all
-D 与 -d 类似,但反汇编所有section
--prefix-addresses
反汇编的时候,显示每一行的完整地址。这是一种比较老的反汇编格式。
显示效果并不理想,但可能会用到其中的某些显示,自己可以对比。
--disassemble-zeroes
一般反汇编输出将省略大块的零,该选项使得这些零块也被反汇编。
-EB
-EL
--endian={big|little}
这个选项将影响反汇编出来的指令。
little-endian就是我们当年在dos下玩汇编的时候常说的高位在高地址,
x86都是这种。--file-headers
-f 显示objfile中每个文件的整体头部摘要信息。--section-headers
--headers
-h 显示目标文件各个section的头部摘要信息。--help 简短的帮助信息。
--info
-i 显示对于 -b 或者 -m 选项可用的架构和目标格式列表。--section=name
-j name 仅仅显示指定section的信息--line-numbers
-l 用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用
使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求
编译时使用了-g之类的调试编译选项。--architecture=machine
-m machine
指定反汇编目标文件时使用的架构,当待反汇编文件本身没有描述
架构信息的时候(比如S-records),这个选项很有用。可以用-i选项
列出这里能够指定的架构--reloc
-r 显示文件的重定位入口。如果和-d或者-D一起使用,重定位部分以反汇
编后的格式显示出来。--dynamic-reloc
-R 显示文件的动态重定位入口,仅仅对于动态目标文件有意义,比如某些
共享库。--full-contents
-s 显示指定section的完整内容。objdump --section=.text -s inet.o | more
--source
-S 尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,
效果比较明显。隐含了-d参数。--show-raw-insn
反汇编的时候,显示每条汇编指令对应的机器码,除非指定了
--prefix-addresses,这将是缺省选项。--no-show-raw-insn
反汇编时,不显示汇编指令的机器码,这是指定 --prefix-addresses
选项时的缺省设置。--stabs
Display the contents of the .stab, .stab.index, and
.stab.excl sections from an ELF file. This is only
useful on systems (such as Solaris 2.0) in which
.stab debugging symbol-table entries are carried in
an ELF section. In most other file formats, debug-
ging symbol-table entries are interleaved with
linkage symbols, and are visible in the --syms output.--start-address=address
从指定地址开始显示数据,该选项影响-d、-r和-s选项的输出。--stop-address=address
显示数据直到指定地址为止,该选项影响-d、-r和-s选项的输出。--syms
-t 显示文件的符号表入口。类似于nm -s提供的信息--dynamic-syms
-T 显示文件的动态符号表入口,仅仅对动态目标文件有意义,比如某些
共享库。它显示的信息类似于 nm -D|--dynamic 显示的信息。--version 版本信息
objdump --version
--all-headers
-x 显示所有可用的头信息,包括符号表、重定位入口。-x 等价于
-a -f -h -r -t 同时指定。objdump -x inet.o
参看 nm(1)
★ objdump应用举例(待增加)
/*
g++ -g -Wstrict-prototypes -Wall -Wunused -o objtest objtest.c
*/
#include
#include
int main ( int argc, char * argv[] )
{
execl( "/bin/sh", "/bin/sh", "-i", 0 );
return 0;
}g++ -g -Wstrict-prototypes -Wall -Wunused -o objtest objtest.c
objdump -j .text -Sl objtest | more
/main(查找)08048750:
main():
/home/scz/src/objtest.c:7
*/
#include
#include
int main ( int argc, char * argv[] )
{
8048750: 55 pushl %ebp
8048751: 89 e5 movl %esp,%ebp
/home/scz/src/objtest.c:8
execl( "/bin/sh", "/bin/sh", "-i", 0 );
8048753: 6a 00 pushl $0x0
8048755: 68 d0 87 04 08 pushl $0x80487d0
804875a: 68 d3 87 04 08 pushl $0x80487d3
804875f: 68 d3 87 04 08 pushl $0x80487d3
8048764: e8 db fe ff ff call 8048644 <_init+0x40>
8048769: 83 c4 10 addl $0x10,%esp
/home/scz/src/objtest.c:9
return 0;
804876c: 31 c0 xorl %eax,%eax
804876e: eb 04 jmp 8048774
8048770: 31 c0 xorl %eax,%eax
8048772: eb 00 jmp 8048774
/home/scz/src/objtest.c:10
}
8048774: c9 leave
8048775: c3 ret
8048776: 90 nop如果说上面还不够清楚,可以用下面的命令辅助一下:
objdump -j .text -Sl objtest --prefix-addresses | more
objdump -j .text -Dl objtest | more用以上不同的命令去试会得到惊喜!
-
objdump使用
2016-10-15 19:20:48objdumpobjdump命令是Linux下的反汇编目标文件或者可执行文件的命令,在分析so库文件时作用也非常显著。
在linux下编译ffmpeg最新版3.1.4,在lib文件夹中得到libavcodec.so文件
使用objdump -x命令分析该so文件:
objdump的help如下:-x, –all-headers Display the contents of all headers
能得到该so文件所依赖的库及版本,以及各个段的信息版本定义: 1 0x01 0x0e9774b7 libavcodec.so.57 2 0x00 0x035ff8b7
LIBAVCODEC_57版本引用: required from libz.so.1:
0x0827e5c0 0x00 11 ZLIB_1.2.0 required from libswresample.so.2:
0x03a93182 0x00 09 LIBSWRESAMPLE_2 required from libc.so.6:
0x06969194 0x00 12 GLIBC_2.14
0x0d696914 0x00 10 GLIBC_2.4
0x09691974 0x00 07 GLIBC_2.3.4
0x09691a75 0x00 06 GLIBC_2.2.5 required from libpthread.so.0:
0x09691a75 0x00 08 GLIBC_2.2.5
0x09691972 0x00 05 GLIBC_2.3.2 required from libavutil.so.55:
0x0f818435 0x00 04 LIBAVUTIL_55 required from libm.so.6:
0x09691a75 0x00 03 GLIBC_2.2.5使用objdump -T分析ELF文件,能得到文件的dynamic symbol table
libavcodec.so.57.48.101: 文件格式 elf64-x86-64
DYNAMIC SYMBOL TABLE:
00000000007de490 g DO .rodata 0000000000000011 LIBAVCODEC_57 avpriv_mjpeg_bits_ac_luminance
00000000001483a0 g DF .text 0000000000000026 LIBAVCODEC_57 av_picture_copy其中导出的函数信息在代码段或者数据段内
在可执行文件ffmpeg内也能找到该so的函数
-
linux objdump binary file
2020-10-27 09:27:13编译出objdump二进制文件,可以直接使用,用于反汇编; 修改权限:chmod +x objdump 使用示例:objdump -d a.out(gcc编译出的可执行文件) -
linux-objdump
2018-04-07 10:54:00ObjDump 1. Synopsis ----------------------------------------------------------------------------------- ObjDump is a small Java framework that dumps any Java object to a string. 2. Usage ---------... -
objdump命令
2018-05-27 16:49:17相关: objdump命令 objdump的使用摘要:objdump -x obj:以某种分类信息的形式把目标文件的数据组成输出;<可查到该文件的的所有动态库>objdump -t obj:输出目标文件的符号表()objdump -h obj:...相关:
摘要:
objdump -x obj:以某种分类信息的形式把目标文件的数据组成输出;<可查到该文件的的所有动态库>
objdump -t obj:输出目标文件的符号表()
objdump -h obj:输出目标文件的所有段概括()
objdump -j ./text/.data -S obj:输出指定段的信息(反汇编源代码)
objdump -S obj:输出目标文件的符号表() 当gcc -g时打印更明显objdump -j .text -Sl stack1 | more
-S 尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,
效果比较明显。隐含了-d参数。
-l 用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用
使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求
编译时使用了-g之类的调试编译选项。
-j name 仅仅显示指定section的信息--archive-headers -a 显示档案库的成员信息,类似ls -l将lib*.a的信息列出。 -b bfdname --target=bfdname 指定目标码格式。这不是必须的,objdump能自动识别许多格式,比如: objdump -b oasys -m vax -h fu.o 显示fu.o的头部摘要信息,明确指出该文件是Vax系统下用Oasys编译器生成的目标文件。objdump -i将给出这里可以指定的目标码格式列表。 -C --demangle 将底层的符号名解码成用户级名字,除了去掉所开头的下划线之外,还使得C++函数名以可理解的方式显示出来。 --debugging -g 显示调试信息。企图解析保存在文件中的调试信息并以C语言的语法显示出来。仅仅支持某些类型的调试信息。有些其他的格式被readelf -w支持。 -e --debugging-tags 类似-g选项,但是生成的信息是和ctags工具相兼容的格式。 --disassemble -d 从objfile中反汇编那些特定指令机器码的section。 -D --disassemble-all 与 -d 类似,但反汇编所有section. --prefix-addresses 反汇编的时候,显示每一行的完整地址。这是一种比较老的反汇编格式。 -EB -EL --endian={big|little} 指定目标文件的小端。这个项将影响反汇编出来的指令。在反汇编的文件没描述小端信息的时候用。例如S-records. -f --file-headers 显示objfile中每个文件的整体头部摘要信息。 -h --section-headers --headers 显示目标文件各个section的头部摘要信息。 -H --help 简短的帮助信息。 -i --info 显示对于 -b 或者 -m 选项可用的架构和目标格式列表。 -j name --section=name 仅仅显示指定名称为name的section的信息 -l --line-numbers 用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求编译时使用了-g之类的调试编译选项。 -m machine --architecture=machine 指定反汇编目标文件时使用的架构,当待反汇编文件本身没描述架构信息的时候(比如S-records),这个选项很有用。可以用-i选项列出这里能够指定的架构. --reloc -r 显示文件的重定位入口。如果和-d或者-D一起使用,重定位部分以反汇编后的格式显示出来。 --dynamic-reloc -R 显示文件的动态重定位入口,仅仅对于动态目标文件意义,比如某些共享库。 -s --full-contents 显示指定section的完整内容。默认所有的非空section都会被显示。 -S --source 尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,效果比较明显。隐含了-d参数。 --show-raw-insn 反汇编的时候,显示每条汇编指令对应的机器码,如不指定--prefix-addresses,这将是缺省选项。 --no-show-raw-insn 反汇编时,不显示汇编指令的机器码,如不指定--prefix-addresses,这将是缺省选项。 --start-address=address 从指定地址开始显示数据,该选项影响-d、-r和-s选项的输出。 --stop-address=address 显示数据直到指定地址为止,该项影响-d、-r和-s选项的输出。 -t --syms 显示文件的符号表入口。类似于nm -s提供的信息 -T --dynamic-syms 显示文件的动态符号表入口,仅仅对动态目标文件意义,比如某些共享库。它显示的信息类似于 nm -D|--dynamic 显示的信息。 -V --version 版本信息 --all-headers -x 显示所可用的头信息,包括符号表、重定位入口。-x 等价于-a -f -h -r -t 同时指定。 -z --disassemble-zeroes 一般反汇编输出将省略大块的零,该选项使得这些零块也被反汇编。 @file 可以将选项集中到一个文件中,然后使用这个@file选项载入。
-
objdump 命令
2019-09-17 13:28:54objdump -D -b binary -m i386 a.bin -D表示对全部文件进行反汇编,-b表示二进制,-m表示指令集架构,a.bin就是我们要反汇编的二进制文件 objdump -m可以查看更多支持的指令集架构,如i386:x86-64,i8086等 Usage: ...objdump -D -b binary -m i386 a.bin
-D表示对全部文件进行反汇编,-b表示二进制,-m表示指令集架构,a.bin就是我们要反汇编的二进制文件
objdump -m可以查看更多支持的指令集架构,如i386:x86-64,i8086等
Usage: objdump <option(s)> <file(s)> Display information from object <file(s)>. At least one of the following switches must be given: -a, --archive-headers Display archive header information -f, --file-headers Display the contents of the overall file header -p, --private-headers Display object format specific file header contents -P, --private=OPT,OPT... Display object format specific contents -h, --[section-]headers Display the contents of the section headers -x, --all-headers Display the contents of all headers -d, --disassemble Display assembler contents of executable sections -D, --disassemble-all Display assembler contents of all sections -S, --source Intermix source code with disassembly -s, --full-contents Display the full contents of all sections requested -g, --debugging Display debug information in object file -e, --debugging-tags Display debug information using ctags style -G, --stabs Display (in raw form) any STABS info in the file -W[lLiaprmfFsoRt] or --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames, =frames-interp,=str,=loc,=Ranges,=pubtypes, =gdb_index,=trace_info,=trace_abbrev,=trace_aranges, =addr,=cu_index] Display DWARF info in the file -t, --syms Display the contents of the symbol table(s) -T, --dynamic-syms Display the contents of the dynamic symbol table -r, --reloc Display the relocation entries in the file -R, --dynamic-reloc Display the dynamic relocation entries in the file @<file> Read options from <file> -v, --version Display this program's version number -i, --info List object formats and architectures supported -H, --help Display this information The following switches are optional: -b, --target=BFDNAME Specify the target object format as BFDNAME -m, --architecture=MACHINE Specify the target architecture as MACHINE -j, --section=NAME Only display information for section NAME -M, --disassembler-options=OPT Pass text OPT on to the disassembler -EB --endian=big Assume big endian format when disassembling -EL --endian=little Assume little endian format when disassembling --file-start-context Include context from start of file (with -S) -I, --include=DIR Add DIR to search list for source files -l, --line-numbers Include line numbers and filenames in output -F, --file-offsets Include file offsets when displaying information -C, --demangle[=STYLE] Decode mangled/processed symbol names The STYLE, if specified, can be `auto', `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java' or `gnat' -w, --wide Format output for more than 80 columns -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling --start-address=ADDR Only process data whose address is >= ADDR --stop-address=ADDR Only process data whose address is <= ADDR --prefix-addresses Print complete address alongside disassembly --[no-]show-raw-insn Display hex alongside symbolic disassembly --insn-width=WIDTH Display WIDTH bytes on a single line for -d --adjust-vma=OFFSET Add OFFSET to all displayed section addresses --special-syms Include special symbols in symbol dumps --prefix=PREFIX Add PREFIX to absolute paths for -S --prefix-strip=LEVEL Strip initial directory names for -S --dwarf-depth=N Do not display DIEs at depth N or greater --dwarf-start=N Display DIEs starting with N, at the same depth or deeper --dwarf-check Make additional dwarf internal consistency checks. objdump: supported targets: elf64-x86-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex objdump: supported architectures: i386 i386:x86-64 i386:x64-32 i8086 i386:intel i386:x86-64:intel i386:x64-32:intel i386:nacl i386:x86-64:nacl i386:x64-32:nacl l1om l1om:intel k1om k1om:intel plugin The following i386/x86-64 specific disassembler options are supported for use with the -M switch (multiple options should be separated by commas): x86-64 Disassemble in 64bit mode i386 Disassemble in 32bit mode i8086 Disassemble in 16bit mode att Display instruction in AT&T syntax intel Display instruction in Intel syntax att-mnemonic Display instruction in AT&T mnemonic intel-mnemonic Display instruction in Intel mnemonic addr64 Assume 64bit address size addr32 Assume 32bit address size addr16 Assume 16bit address size data32 Assume 32bit data size data16 Assume 16bit data size suffix Always display instruction suffix in AT&T syntax Report bugs to <http://www.sourceware.org/bugzilla/>.
-
python logging的用法
-
中国各省边界geojson.json
-
linux网络驱动.zip
-
克服范式,达成真正的敏捷
-
测控电路课设报告.docx
-
FTPUpload.rar
-
部分相干涡旋光束的实验研究
-
Hadoop技术
-
歌声合成从入门到精通
-
FastDFS 分布式文件系统部署
-
使用 Linux 平台充当 Router 路由器
-
JUC-线程池
-
MMM 集群部署实现 MySQL 高可用和读写分离
-
羽量级在线 HTML 编辑器
-
2021 年该学的 CSS 框架 Tailwind CSS 实战视频
-
Keil.STM32F2xx_DFP.2.9.0.1.rar
-
脉冲激光强化点阵光斑强度分布反求算法
-
【Python-随到随学】 FLask第一周
-
spark大数据分析与实战
-
SILEX-I超短脉冲激光装置放大前级输出能量稳定性提升