objdump命令

  1 --archive-headers 
  2 -a 
  3 显示档案库的成员信息,类似ls -l将lib*.a的信息列出。 
  4 
  5 -b bfdname 
  6 --target=bfdname 
  7 指定目标码格式。这不是必须的,objdump能自动识别许多格式,比如: 
  8 
  9 objdump -b oasys -m vax -h fu.o 
 10 显示fu.o的头部摘要信息,明确指出该文件是Vax系统下用Oasys编译器生成的目标文件。objdump -i将给出这里可以指定的目标码格式列表。 
 11 
 12 -C 
 13 --demangle 
 14 将底层的符号名解码成用户级名字,除了去掉所开头的下划线之外,还使得C++函数名以可理解的方式显示出来。 
 15 
 16 --debugging 
 17 -g 
 18 显示调试信息。企图解析保存在文件中的调试信息并以C语言的语法显示出来。仅仅支持某些类型的调试信息。有些其他的格式被readelf -w支持。 
 19 
 20 -e 
 21 --debugging-tags 
 22 类似-g选项,但是生成的信息是和ctags工具相兼容的格式。 
 23 
 24 --disassemble 
 25 -d 
 26 从objfile中反汇编那些特定指令机器码的section。
 27 
 28 -D 
 29 --disassemble-all 
 30 与 -d 类似,但反汇编所有section.
 31 
 32 -EB 
 33 -EL 
 34 --endian={big|little} 
 35 指定目标文件的小端。这个项将影响反汇编出来的指令。在反汇编的文件没描述小端信息的时候用。例如S-records. 
 36 
 37 
 38 -f 
 39 --file-headers 
 40 显示objfile中每个文件的整体头部摘要信息。
 41 
 42 -h 
 43 --section-headers 
 44 --headers 
 45 显示目标文件各个section的头部摘要信息。  
 46 
 47 -H 
 48 --help 
 49 简短的帮助信息。 
 50 
 51 -i 
 52 --info 
 53 显示对于 -b 或者 -m 选项可用的架构和目标格式列表。 
 54 
 55 -j name
 56 --section=name 
 57 仅仅显示指定名称为name的section的信息 
 58 
 59 -l
 60 --line-numbers 
 61 用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求编译时使用了-g之类的调试编译选项。 
 62 
 63 -m machine 
 64 --architecture=machine 
 65 指定反汇编目标文件时使用的架构,当待反汇编文件本身没描述架构信息的时候(比如S-records),这个选项很有用。可以用-i选项列出这里能够指定的架构. 
 66 
 67 --reloc 
 68 -r 
 69 显示文件的重定位入口。如果和-d或者-D一起使用,重定位部分以反汇编后的格式显示出来。 
 70 
 71 --dynamic-reloc 
 72 -R 
 73 显示文件的动态重定位入口,仅仅对于动态目标文件意义,比如某些共享库。 
 74 
 75 -s 
 76 --full-contents 
 77 显示指定section的完整内容。默认所有的非空section都会被显示。
 78 
 79 -S 
 80 --source 
 81 尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,效果比较明显。隐含了-d参数。 
 82 
 83 --show-raw-insn 
 84 反汇编的时候,显示每条汇编指令对应的机器码,如不指定--prefix-addresses,这将是缺省选项。 
 85 
 86 --no-show-raw-insn 
 87 反汇编时,不显示汇编指令的机器码,如不指定--prefix-addresses,这将是缺省选项。 
 88 
 89 --start-address=address 
 90 从指定地址开始显示数据,该选项影响-d、-r和-s选项的输出。 
 91 
 92 --stop-address=address 
 93 显示数据直到指定地址为止,该项影响-d、-r和-s选项的输出。 
 94 
 95 -t 
 96 --syms 
 97 显示文件的符号表入口。类似于nm -s提供的信息 
 98 
 99 
100 -T 
101 --dynamic-syms 
102 显示文件的动态符号表入口,仅仅对动态目标文件意义,比如某些共享库。它显示的信息类似于 nm -D|--dynamic 显示的信息。 
103 
104 -V 
105 --version 
106 版本信息 
107 
108 --all-headers 
109 -x 
110 显示所可用的头信息,包括符号表、重定位入口。-x 等价于-a -f -h -r -t 同时指定。 
111 
112 -z 
113 --disassemble-zeroes 
114 一般反汇编输出将省略大块的零,该选项使得这些零块也被反汇编。
115 
116 @file 可以将选项集中到一个文件中,然后使用这个@file选项载入。

 例如:针对代码study.c:

1 #include <stdio.h>
2
3 #define NUMBER_1 1
4 #define NUMBER_2 2
5
6 int main(int argc, char **argv)
7 {
8     int a;
9     int b;
10     int c;
11     a = NUMBER_1;               //This is be deleted by pre-processing
12     b = NUMBER_2;
13     c = a + b;
14
15     printf("Output c: %d\n", c);
16
17     return 0;
18 }

编译:gcc -g study.c -o study

显示study文件中text段的内容

objdump --section=.text -s study

study:     file format elf64-x86-64

Contents of section .text:
1060 f30f1efa 31ed4989 d15e4889 e24883e4  ....1.I..^H..H..
1070 f0505445 31c031c9 488d3dca 000000ff  .PTE1.1.H.=.....
1080 15532f00 00f4662e 0f1f8400 00000000  .S/...f.........
1090 488d3d79 2f000048 8d05722f 00004839  H.=y/..H..r/..H9
10a0 f8741548 8b05362f 00004885 c07409ff  .t.H..6/..H..t..
10b0 e00f1f80 00000000 c30f1f80 00000000  ................
10c0 488d3d49 2f000048 8d35422f 00004829  H.=I/..H.5B/..H)
10d0 fe4889f0 48c1ee3f 48c1f803 4801c648  .H..H..?H...H..H
10e0 d1fe7414 488b0505 2f000048 85c07408  ..t.H.../..H..t.
10f0 ffe0660f 1f440000 c30f1f80 00000000  ..f..D..........
1100 f30f1efa 803d052f 00000075 2b554883  .....=./...u+UH.
1110 3de22e00 00004889 e5740c48 8b3de62e  =.....H..t.H.=..
1120 0000e819 ffffffe8 64ffffff c605dd2e  ........d.......
1130 0000015d c30f1f00 c30f1f80 00000000  ...]............
1140 f30f1efa e977ffff fff30f1e fa554889  .....w.......UH.
1150 e54883ec 20897dec 488975e0 c745f401  .H.. .}.H.u..E..
1160 000000c7 45f80200 00008b55 f48b45f8  ....E......U..E.
1170 01d08945 fc8b45fc 89c6488d 05830e00  ...E..E...H.....
1180 004889c7 b8000000 00e8c2fe ffffb800  .H..............
1190 000000c9 c3

反汇编study中的text段内容,并尽可能用源代码形式展示:

objdump --section=.text -S study

study:     file format elf64-x86-64


Disassembly of section .text:

0000000000001060 <_start>:
1060:       f3 0f 1e fa             endbr64
1064:       31 ed                   xor    %ebp,%ebp
1066:       49 89 d1                mov    %rdx,%r9
1069:       5e                      pop    %rsi
106a:       48 89 e2                mov    %rsp,%rdx
106d:       48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
1071:       50                      push   %rax
1072:       54                      push   %rsp
1073:       45 31 c0                xor    %r8d,%r8d
1076:       31 c9                   xor    %ecx,%ecx
1078:       48 8d 3d ca 00 00 00    lea    0xca(%rip),%rdi        # 1149 <main>
107f:       ff 15 53 2f 00 00       call   *0x2f53(%rip)        # 3fd8 <__libc_start_main@GLIBC_2.34>
1085:       f4                      hlt
1086:       66 2e 0f 1f 84 00 00    cs nopw 0x0(%rax,%rax,1)
108d:       00 00 00

0000000000001090 <deregister_tm_clones>:
1090:       48 8d 3d 79 2f 00 00    lea    0x2f79(%rip),%rdi        # 4010 <__TMC_END__>
1097:       48 8d 05 72 2f 00 00    lea    0x2f72(%rip),%rax        # 4010 <__TMC_END__>
109e:       48 39 f8                cmp    %rdi,%rax
10a1:       74 15                   je     10b8 <deregister_tm_clones+0x28>
10a3:       48 8b 05 36 2f 00 00    mov    0x2f36(%rip),%rax        # 3fe0 <_ITM_deregisterTMCloneTable@Base>
10aa:       48 85 c0                test   %rax,%rax
10ad:       74 09                   je     10b8 <deregister_tm_clones+0x28>
10af:       ff e0                   jmp    *%rax
10b1:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
10b8:       c3                      ret
10b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000000010c0 <register_tm_clones>:
10c0:       48 8d 3d 49 2f 00 00    lea    0x2f49(%rip),%rdi        # 4010 <__TMC_END__>
10c7:       48 8d 35 42 2f 00 00    lea    0x2f42(%rip),%rsi        # 4010 <__TMC_END__>
10ce:       48 29 fe                sub    %rdi,%rsi
10d1:       48 89 f0                mov    %rsi,%rax
10d4:       48 c1 ee 3f             shr    $0x3f,%rsi
10d8:       48 c1 f8 03             sar    $0x3,%rax
10dc:       48 01 c6                add    %rax,%rsi
10df:       48 d1 fe                sar    %rsi
10e2:       74 14                   je     10f8 <register_tm_clones+0x38>
10e4:       48 8b 05 05 2f 00 00    mov    0x2f05(%rip),%rax        # 3ff0 <_ITM_registerTMCloneTable@Base>
10eb:       48 85 c0                test   %rax,%rax
10ee:       74 08                   je     10f8 <register_tm_clones+0x38>
10f0:       ff e0                   jmp    *%rax
10f2:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
10f8:       c3                      ret
10f9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001100 <__do_global_dtors_aux>:
1100:       f3 0f 1e fa             endbr64
1104:       80 3d 05 2f 00 00 00    cmpb   $0x0,0x2f05(%rip)        # 4010 <__TMC_END__>
110b:       75 2b                   jne    1138 <__do_global_dtors_aux+0x38>
110d:       55                      push   %rbp
110e:       48 83 3d e2 2e 00 00    cmpq   $0x0,0x2ee2(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
1115:       00
1116:       48 89 e5                mov    %rsp,%rbp
1119:       74 0c                   je     1127 <__do_global_dtors_aux+0x27>
111b:       48 8b 3d e6 2e 00 00    mov    0x2ee6(%rip),%rdi        # 4008 <__dso_handle>
1122:       e8 19 ff ff ff          call   1040 <__cxa_finalize@plt>
1127:       e8 64 ff ff ff          call   1090 <deregister_tm_clones>
112c:       c6 05 dd 2e 00 00 01    movb   $0x1,0x2edd(%rip)        # 4010 <__TMC_END__>
1133:       5d                      pop    %rbp
1134:       c3                      ret
1135:       0f 1f 00                nopl   (%rax)
1138:       c3                      ret
1139:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001140 <frame_dummy>:
1140:       f3 0f 1e fa             endbr64
1144:       e9 77 ff ff ff          jmp    10c0 <register_tm_clones>

0000000000001149 <main>:
objdump: Warning: source file /home/guochaoxxl/tmp/study.c is more recent than object file

#define NUMBER_1 1
#define NUMBER_2 2

int main(int argc, char **argv)
{
1149:       f3 0f 1e fa             endbr64
114d:       55                      push   %rbp
114e:       48 89 e5                mov    %rsp,%rbp
1151:       48 83 ec 20             sub    $0x20,%rsp
1155:       89 7d ec                mov    %edi,-0x14(%rbp)
1158:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
int a;
int b;
int c;
a = NUMBER_1;                           //This is be deleted by pre-processing
115c:       c7 45 f4 01 00 00 00    movl   $0x1,-0xc(%rbp)
b = NUMBER_2;
1163:       c7 45 f8 02 00 00 00    movl   $0x2,-0x8(%rbp)
c = a + b;
116a:       8b 55 f4                mov    -0xc(%rbp),%edx
116d:       8b 45 f8                mov    -0x8(%rbp),%eax
1170:       01 d0                   add    %edx,%eax
1172:       89 45 fc                mov    %eax,-0x4(%rbp)

printf("Output c: %d\n", c);
1175:       8b 45 fc                mov    -0x4(%rbp),%eax
1178:       89 c6                   mov    %eax,%esi
117a:       48 8d 05 83 0e 00 00    lea    0xe83(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
1181:       48 89 c7                mov    %rax,%rdi
1184:       b8 00 00 00 00          mov    $0x0,%eax
1189:       e8 c2 fe ff ff          call   1050 <printf@plt>

return 0;
118e:       b8 00 00 00 00          mov    $0x0,%eax
}
1193:       c9                      leave
1194:       c3                      ret

  反汇编出study.o的源代码:

objdump -S study

study:     file format elf64-x86-64


Disassembly of section .init:

0000000000001000 <_init>:
1000:       f3 0f 1e fa             endbr64
1004:       48 83 ec 08             sub    $0x8,%rsp
1008:       48 8b 05 d9 2f 00 00    mov    0x2fd9(%rip),%rax        # 3fe8 <__gmon_start__@Base>
100f:       48 85 c0                test   %rax,%rax
1012:       74 02                   je     1016 <_init+0x16>
1014:       ff d0                   call   *%rax
1016:       48 83 c4 08             add    $0x8,%rsp
101a:       c3                      ret

Disassembly of section .plt:

0000000000001020 <.plt>:
1020:       ff 35 9a 2f 00 00       push   0x2f9a(%rip)        # 3fc0 <_GLOBAL_OFFSET_TABLE_+0x8>
1026:       f2 ff 25 9b 2f 00 00    bnd jmp *0x2f9b(%rip)        # 3fc8 <_GLOBAL_OFFSET_TABLE_+0x10>
102d:       0f 1f 00                nopl   (%rax)
1030:       f3 0f 1e fa             endbr64
1034:       68 00 00 00 00          push   $0x0
1039:       f2 e9 e1 ff ff ff       bnd jmp 1020 <_init+0x20>
103f:       90                      nop

Disassembly of section .plt.got:

0000000000001040 <__cxa_finalize@plt>:
1040:       f3 0f 1e fa             endbr64
1044:       f2 ff 25 ad 2f 00 00    bnd jmp *0x2fad(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
104b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

Disassembly of section .plt.sec:

0000000000001050 <printf@plt>:
1050:       f3 0f 1e fa             endbr64
1054:       f2 ff 25 75 2f 00 00    bnd jmp *0x2f75(%rip)        # 3fd0 <printf@GLIBC_2.2.5>
105b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

Disassembly of section .text:

0000000000001060 <_start>:
1060:       f3 0f 1e fa             endbr64
1064:       31 ed                   xor    %ebp,%ebp
1066:       49 89 d1                mov    %rdx,%r9
1069:       5e                      pop    %rsi
106a:       48 89 e2                mov    %rsp,%rdx
106d:       48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
1071:       50                      push   %rax
1072:       54                      push   %rsp
1073:       45 31 c0                xor    %r8d,%r8d
1076:       31 c9                   xor    %ecx,%ecx
1078:       48 8d 3d ca 00 00 00    lea    0xca(%rip),%rdi        # 1149 <main>
107f:       ff 15 53 2f 00 00       call   *0x2f53(%rip)        # 3fd8 <__libc_start_main@GLIBC_2.34>
1085:       f4                      hlt
1086:       66 2e 0f 1f 84 00 00    cs nopw 0x0(%rax,%rax,1)
108d:       00 00 00

0000000000001090 <deregister_tm_clones>:
1090:       48 8d 3d 79 2f 00 00    lea    0x2f79(%rip),%rdi        # 4010 <__TMC_END__>
1097:       48 8d 05 72 2f 00 00    lea    0x2f72(%rip),%rax        # 4010 <__TMC_END__>
109e:       48 39 f8                cmp    %rdi,%rax
10a1:       74 15                   je     10b8 <deregister_tm_clones+0x28>
10a3:       48 8b 05 36 2f 00 00    mov    0x2f36(%rip),%rax        # 3fe0 <_ITM_deregisterTMCloneTable@Base>
10aa:       48 85 c0                test   %rax,%rax
10ad:       74 09                   je     10b8 <deregister_tm_clones+0x28>
10af:       ff e0                   jmp    *%rax
10b1:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
10b8:       c3                      ret
10b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000000010c0 <register_tm_clones>:
10c0:       48 8d 3d 49 2f 00 00    lea    0x2f49(%rip),%rdi        # 4010 <__TMC_END__>
10c7:       48 8d 35 42 2f 00 00    lea    0x2f42(%rip),%rsi        # 4010 <__TMC_END__>
10ce:       48 29 fe                sub    %rdi,%rsi
10d1:       48 89 f0                mov    %rsi,%rax
10d4:       48 c1 ee 3f             shr    $0x3f,%rsi
10d8:       48 c1 f8 03             sar    $0x3,%rax
10dc:       48 01 c6                add    %rax,%rsi
10df:       48 d1 fe                sar    %rsi
10e2:       74 14                   je     10f8 <register_tm_clones+0x38>
10e4:       48 8b 05 05 2f 00 00    mov    0x2f05(%rip),%rax        # 3ff0 <_ITM_registerTMCloneTable@Base>
10eb:       48 85 c0                test   %rax,%rax
10ee:       74 08                   je     10f8 <register_tm_clones+0x38>
10f0:       ff e0                   jmp    *%rax
10f2:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
10f8:       c3                      ret
10f9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001100 <__do_global_dtors_aux>:
1100:       f3 0f 1e fa             endbr64
1104:       80 3d 05 2f 00 00 00    cmpb   $0x0,0x2f05(%rip)        # 4010 <__TMC_END__>
110b:       75 2b                   jne    1138 <__do_global_dtors_aux+0x38>
110d:       55                      push   %rbp
110e:       48 83 3d e2 2e 00 00    cmpq   $0x0,0x2ee2(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
1115:       00
1116:       48 89 e5                mov    %rsp,%rbp
1119:       74 0c                   je     1127 <__do_global_dtors_aux+0x27>
111b:       48 8b 3d e6 2e 00 00    mov    0x2ee6(%rip),%rdi        # 4008 <__dso_handle>
1122:       e8 19 ff ff ff          call   1040 <__cxa_finalize@plt>
1127:       e8 64 ff ff ff          call   1090 <deregister_tm_clones>
112c:       c6 05 dd 2e 00 00 01    movb   $0x1,0x2edd(%rip)        # 4010 <__TMC_END__>
1133:       5d                      pop    %rbp
1134:       c3                      ret
1135:       0f 1f 00                nopl   (%rax)
1138:       c3                      ret
1139:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001140 <frame_dummy>:
1140:       f3 0f 1e fa             endbr64
1144:       e9 77 ff ff ff          jmp    10c0 <register_tm_clones>

0000000000001149 <main>:
objdump: Warning: source file /home/guochaoxxl/tmp/study.c is more recent than object file

#define NUMBER_1 1
#define NUMBER_2 2

int main(int argc, char **argv)
{
1149:       f3 0f 1e fa             endbr64
114d:       55                      push   %rbp
114e:       48 89 e5                mov    %rsp,%rbp
1151:       48 83 ec 20             sub    $0x20,%rsp
1155:       89 7d ec                mov    %edi,-0x14(%rbp)
1158:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
int a;
int b;
int c;
a = NUMBER_1;                           //This is be deleted by pre-processing
115c:       c7 45 f4 01 00 00 00    movl   $0x1,-0xc(%rbp)
b = NUMBER_2;
1163:       c7 45 f8 02 00 00 00    movl   $0x2,-0x8(%rbp)
c = a + b;
116a:       8b 55 f4                mov    -0xc(%rbp),%edx
116d:       8b 45 f8                mov    -0x8(%rbp),%eax
1170:       01 d0                   add    %edx,%eax
1172:       89 45 fc                mov    %eax,-0x4(%rbp)

printf("Output c: %d\n", c);
1175:       8b 45 fc                mov    -0x4(%rbp),%eax
1178:       89 c6                   mov    %eax,%esi
117a:       48 8d 05 83 0e 00 00    lea    0xe83(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
1181:       48 89 c7                mov    %rax,%rdi
1184:       b8 00 00 00 00          mov    $0x0,%eax
1189:       e8 c2 fe ff ff          call   1050 <printf@plt>

return 0;
118e:       b8 00 00 00 00          mov    $0x0,%eax
}
1193:       c9                      leave
1194:       c3                      ret

Disassembly of section .fini:

0000000000001198 <_fini>:
1198:       f3 0f 1e fa             endbr64
119c:       48 83 ec 08             sub    $0x8,%rsp
11a0:       48 83 c4 08             add    $0x8,%rsp
11a4:       c3                      ret

显示文件的符号表入口:

objdump -t study

study:     file format elf64-x86-64

SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000              Scrt1.o
000000000000038c l     O .note.ABI-tag  0000000000000020              __abi_tag
0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c
0000000000001090 l     F .text  0000000000000000              deregister_tm_clones
00000000000010c0 l     F .text  0000000000000000              register_tm_clones
0000000000001100 l     F .text  0000000000000000              __do_global_dtors_aux
0000000000004010 l     O .bss   0000000000000001              completed.0
0000000000003dc0 l     O .fini_array    0000000000000000              __do_global_dtors_aux_fini_array_entry
0000000000001140 l     F .text  0000000000000000              frame_dummy
0000000000003db8 l     O .init_array    0000000000000000              __frame_dummy_init_array_entry
0000000000000000 l    df *ABS*  0000000000000000              study.c
0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c
00000000000020f0 l     O .eh_frame      0000000000000000              __FRAME_END__
0000000000000000 l    df *ABS*  0000000000000000
0000000000003dc8 l     O .dynamic       0000000000000000              _DYNAMIC
0000000000002014 l       .eh_frame_hdr  0000000000000000              __GNU_EH_FRAME_HDR
0000000000003fb8 l     O .got   0000000000000000              _GLOBAL_OFFSET_TABLE_
0000000000000000       F *UND*  0000000000000000              __libc_start_main@GLIBC_2.34
0000000000000000  w      *UND*  0000000000000000              _ITM_deregisterTMCloneTable
0000000000004000  w      .data  0000000000000000              data_start
0000000000004010 g       .data  0000000000000000              _edata
0000000000001198 g     F .fini  0000000000000000              .hidden _fini
0000000000000000       F *UND*  0000000000000000              printf@GLIBC_2.2.5
0000000000004000 g       .data  0000000000000000              __data_start
0000000000000000  w      *UND*  0000000000000000              __gmon_start__
0000000000004008 g     O .data  0000000000000000              .hidden __dso_handle
0000000000002000 g     O .rodata        0000000000000004              _IO_stdin_used
0000000000004018 g       .bss   0000000000000000              _end
0000000000001060 g     F .text  0000000000000026              _start
0000000000004010 g       .bss   0000000000000000              __bss_start
0000000000001149 g     F .text  000000000000004c              main
0000000000004010 g     O .data  0000000000000000              .hidden __TMC_END__
0000000000000000  w      *UND*  0000000000000000              _ITM_registerTMCloneTable
0000000000000000  w    F *UND*  0000000000000000              __cxa_finalize@GLIBC_2.2.5
0000000000001000 g     F .init  0000000000000000              .hidden _init

显示文件的符号表入口,将底层符号解码并表示成用户级别:

objdump -t -C study

study:     file format elf64-x86-64

SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000              Scrt1.o
000000000000038c l     O .note.ABI-tag  0000000000000020              __abi_tag
0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c
0000000000001090 l     F .text  0000000000000000              deregister_tm_clones
00000000000010c0 l     F .text  0000000000000000              register_tm_clones
0000000000001100 l     F .text  0000000000000000              __do_global_dtors_aux
0000000000004010 l     O .bss   0000000000000001              completed.0
0000000000003dc0 l     O .fini_array    0000000000000000              __do_global_dtors_aux_fini_array_entry
0000000000001140 l     F .text  0000000000000000              frame_dummy
0000000000003db8 l     O .init_array    0000000000000000              __frame_dummy_init_array_entry
0000000000000000 l    df *ABS*  0000000000000000              study.c
0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c
00000000000020f0 l     O .eh_frame      0000000000000000              __FRAME_END__
0000000000000000 l    df *ABS*  0000000000000000
0000000000003dc8 l     O .dynamic       0000000000000000              _DYNAMIC
0000000000002014 l       .eh_frame_hdr  0000000000000000              __GNU_EH_FRAME_HDR
0000000000003fb8 l     O .got   0000000000000000              _GLOBAL_OFFSET_TABLE_
0000000000000000       F *UND*  0000000000000000              __libc_start_main@GLIBC_2.34
0000000000000000  w      *UND*  0000000000000000              _ITM_deregisterTMCloneTable
0000000000004000  w      .data  0000000000000000              data_start
0000000000004010 g       .data  0000000000000000              _edata
0000000000001198 g     F .fini  0000000000000000              .hidden _fini
0000000000000000       F *UND*  0000000000000000              printf@GLIBC_2.2.5
0000000000004000 g       .data  0000000000000000              __data_start
0000000000000000  w      *UND*  0000000000000000              __gmon_start__
0000000000004008 g     O .data  0000000000000000              .hidden __dso_handle
0000000000002000 g     O .rodata        0000000000000004              _IO_stdin_used
0000000000004018 g       .bss   0000000000000000              _end
0000000000001060 g     F .text  0000000000000026              _start
0000000000004010 g       .bss   0000000000000000              __bss_start
0000000000001149 g     F .text  000000000000004c              main
0000000000004010 g     O .data  0000000000000000              .hidden __TMC_END__
0000000000000000  w      *UND*  0000000000000000              _ITM_registerTMCloneTable
0000000000000000  w    F *UND*  0000000000000000              __cxa_finalize@GLIBC_2.2.5
0000000000001000 g     F .init  0000000000000000              .hidden _init

反汇编目标文件的特定机器码段:

objdump -d study

study:     file format elf64-x86-64


Disassembly of section .init:

0000000000001000 <_init>:
1000:       f3 0f 1e fa             endbr64
1004:       48 83 ec 08             sub    $0x8,%rsp
1008:       48 8b 05 d9 2f 00 00    mov    0x2fd9(%rip),%rax        # 3fe8 <__gmon_start__@Base>
100f:       48 85 c0                test   %rax,%rax
1012:       74 02                   je     1016 <_init+0x16>
1014:       ff d0                   call   *%rax
1016:       48 83 c4 08             add    $0x8,%rsp
101a:       c3                      ret

Disassembly of section .plt:

0000000000001020 <.plt>:
1020:       ff 35 9a 2f 00 00       push   0x2f9a(%rip)        # 3fc0 <_GLOBAL_OFFSET_TABLE_+0x8>
1026:       f2 ff 25 9b 2f 00 00    bnd jmp *0x2f9b(%rip)        # 3fc8 <_GLOBAL_OFFSET_TABLE_+0x10>
102d:       0f 1f 00                nopl   (%rax)
1030:       f3 0f 1e fa             endbr64
1034:       68 00 00 00 00          push   $0x0
1039:       f2 e9 e1 ff ff ff       bnd jmp 1020 <_init+0x20>
103f:       90                      nop

Disassembly of section .plt.got:

0000000000001040 <__cxa_finalize@plt>:
1040:       f3 0f 1e fa             endbr64
1044:       f2 ff 25 ad 2f 00 00    bnd jmp *0x2fad(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
104b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

Disassembly of section .plt.sec:

0000000000001050 <printf@plt>:
1050:       f3 0f 1e fa             endbr64
1054:       f2 ff 25 75 2f 00 00    bnd jmp *0x2f75(%rip)        # 3fd0 <printf@GLIBC_2.2.5>
105b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

Disassembly of section .text:

0000000000001060 <_start>:
1060:       f3 0f 1e fa             endbr64
1064:       31 ed                   xor    %ebp,%ebp
1066:       49 89 d1                mov    %rdx,%r9
1069:       5e                      pop    %rsi
106a:       48 89 e2                mov    %rsp,%rdx
106d:       48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
1071:       50                      push   %rax
1072:       54                      push   %rsp
1073:       45 31 c0                xor    %r8d,%r8d
1076:       31 c9                   xor    %ecx,%ecx
1078:       48 8d 3d ca 00 00 00    lea    0xca(%rip),%rdi        # 1149 <main>
107f:       ff 15 53 2f 00 00       call   *0x2f53(%rip)        # 3fd8 <__libc_start_main@GLIBC_2.34>
1085:       f4                      hlt
1086:       66 2e 0f 1f 84 00 00    cs nopw 0x0(%rax,%rax,1)
108d:       00 00 00

0000000000001090 <deregister_tm_clones>:
1090:       48 8d 3d 79 2f 00 00    lea    0x2f79(%rip),%rdi        # 4010 <__TMC_END__>
1097:       48 8d 05 72 2f 00 00    lea    0x2f72(%rip),%rax        # 4010 <__TMC_END__>
109e:       48 39 f8                cmp    %rdi,%rax
10a1:       74 15                   je     10b8 <deregister_tm_clones+0x28>
10a3:       48 8b 05 36 2f 00 00    mov    0x2f36(%rip),%rax        # 3fe0 <_ITM_deregisterTMCloneTable@Base>
10aa:       48 85 c0                test   %rax,%rax
10ad:       74 09                   je     10b8 <deregister_tm_clones+0x28>
10af:       ff e0                   jmp    *%rax
10b1:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
10b8:       c3                      ret
10b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000000010c0 <register_tm_clones>:
10c0:       48 8d 3d 49 2f 00 00    lea    0x2f49(%rip),%rdi        # 4010 <__TMC_END__>
10c7:       48 8d 35 42 2f 00 00    lea    0x2f42(%rip),%rsi        # 4010 <__TMC_END__>
10ce:       48 29 fe                sub    %rdi,%rsi
10d1:       48 89 f0                mov    %rsi,%rax
10d4:       48 c1 ee 3f             shr    $0x3f,%rsi
10d8:       48 c1 f8 03             sar    $0x3,%rax
10dc:       48 01 c6                add    %rax,%rsi
10df:       48 d1 fe                sar    %rsi
10e2:       74 14                   je     10f8 <register_tm_clones+0x38>
10e4:       48 8b 05 05 2f 00 00    mov    0x2f05(%rip),%rax        # 3ff0 <_ITM_registerTMCloneTable@Base>
10eb:       48 85 c0                test   %rax,%rax
10ee:       74 08                   je     10f8 <register_tm_clones+0x38>
10f0:       ff e0                   jmp    *%rax
10f2:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
10f8:       c3                      ret
10f9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001100 <__do_global_dtors_aux>:
1100:       f3 0f 1e fa             endbr64
1104:       80 3d 05 2f 00 00 00    cmpb   $0x0,0x2f05(%rip)        # 4010 <__TMC_END__>
110b:       75 2b                   jne    1138 <__do_global_dtors_aux+0x38>
110d:       55                      push   %rbp
110e:       48 83 3d e2 2e 00 00    cmpq   $0x0,0x2ee2(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
1115:       00
1116:       48 89 e5                mov    %rsp,%rbp
1119:       74 0c                   je     1127 <__do_global_dtors_aux+0x27>
111b:       48 8b 3d e6 2e 00 00    mov    0x2ee6(%rip),%rdi        # 4008 <__dso_handle>
1122:       e8 19 ff ff ff          call   1040 <__cxa_finalize@plt>
1127:       e8 64 ff ff ff          call   1090 <deregister_tm_clones>
112c:       c6 05 dd 2e 00 00 01    movb   $0x1,0x2edd(%rip)        # 4010 <__TMC_END__>
1133:       5d                      pop    %rbp
1134:       c3                      ret
1135:       0f 1f 00                nopl   (%rax)
1138:       c3                      ret
1139:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001140 <frame_dummy>:
1140:       f3 0f 1e fa             endbr64
1144:       e9 77 ff ff ff          jmp    10c0 <register_tm_clones>

0000000000001149 <main>:
1149:       f3 0f 1e fa             endbr64
114d:       55                      push   %rbp
114e:       48 89 e5                mov    %rsp,%rbp
1151:       48 83 ec 20             sub    $0x20,%rsp
1155:       89 7d ec                mov    %edi,-0x14(%rbp)
1158:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
115c:       c7 45 f4 01 00 00 00    movl   $0x1,-0xc(%rbp)
1163:       c7 45 f8 02 00 00 00    movl   $0x2,-0x8(%rbp)
116a:       8b 55 f4                mov    -0xc(%rbp),%edx
116d:       8b 45 f8                mov    -0x8(%rbp),%eax
1170:       01 d0                   add    %edx,%eax
1172:       89 45 fc                mov    %eax,-0x4(%rbp)
1175:       8b 45 fc                mov    -0x4(%rbp),%eax
1178:       89 c6                   mov    %eax,%esi
117a:       48 8d 05 83 0e 00 00    lea    0xe83(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
1181:       48 89 c7                mov    %rax,%rdi
1184:       b8 00 00 00 00          mov    $0x0,%eax
1189:       e8 c2 fe ff ff          call   1050 <printf@plt>
118e:       b8 00 00 00 00          mov    $0x0,%eax
1193:       c9                      leave
1194:       c3                      ret

Disassembly of section .fini:

0000000000001198 <_fini>:
1198:       f3 0f 1e fa             endbr64
119c:       48 83 ec 08             sub    $0x8,%rsp
11a0:       48 83 c4 08             add    $0x8,%rsp
11a4:       c3                      ret

反汇编特定段,并将汇编代码对应的文件名称和行号对应上:

objdump -d -l study

study:     file format elf64-x86-64


Disassembly of section .init:

0000000000001000 <_init>:
_init():
1000:       f3 0f 1e fa             endbr64
1004:       48 83 ec 08             sub    $0x8,%rsp
1008:       48 8b 05 d9 2f 00 00    mov    0x2fd9(%rip),%rax        # 3fe8 <__gmon_start__@Base>
100f:       48 85 c0                test   %rax,%rax
1012:       74 02                   je     1016 <_init+0x16>
1014:       ff d0                   call   *%rax
1016:       48 83 c4 08             add    $0x8,%rsp
101a:       c3                      ret

Disassembly of section .plt:

0000000000001020 <.plt>:
1020:       ff 35 9a 2f 00 00       push   0x2f9a(%rip)        # 3fc0 <_GLOBAL_OFFSET_TABLE_+0x8>
1026:       f2 ff 25 9b 2f 00 00    bnd jmp *0x2f9b(%rip)        # 3fc8 <_GLOBAL_OFFSET_TABLE_+0x10>
102d:       0f 1f 00                nopl   (%rax)
1030:       f3 0f 1e fa             endbr64
1034:       68 00 00 00 00          push   $0x0
1039:       f2 e9 e1 ff ff ff       bnd jmp 1020 <_init+0x20>
103f:       90                      nop

Disassembly of section .plt.got:

0000000000001040 <__cxa_finalize@plt>:
1040:       f3 0f 1e fa             endbr64
1044:       f2 ff 25 ad 2f 00 00    bnd jmp *0x2fad(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
104b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

Disassembly of section .plt.sec:

0000000000001050 <printf@plt>:
1050:       f3 0f 1e fa             endbr64
1054:       f2 ff 25 75 2f 00 00    bnd jmp *0x2f75(%rip)        # 3fd0 <printf@GLIBC_2.2.5>
105b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

Disassembly of section .text:

0000000000001060 <_start>:
_start():
1060:       f3 0f 1e fa             endbr64
1064:       31 ed                   xor    %ebp,%ebp
1066:       49 89 d1                mov    %rdx,%r9
1069:       5e                      pop    %rsi
106a:       48 89 e2                mov    %rsp,%rdx
106d:       48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
1071:       50                      push   %rax
1072:       54                      push   %rsp
1073:       45 31 c0                xor    %r8d,%r8d
1076:       31 c9                   xor    %ecx,%ecx
1078:       48 8d 3d ca 00 00 00    lea    0xca(%rip),%rdi        # 1149 <main>
107f:       ff 15 53 2f 00 00       call   *0x2f53(%rip)        # 3fd8 <__libc_start_main@GLIBC_2.34>
1085:       f4                      hlt
1086:       66 2e 0f 1f 84 00 00    cs nopw 0x0(%rax,%rax,1)
108d:       00 00 00

0000000000001090 <deregister_tm_clones>:
deregister_tm_clones():
1090:       48 8d 3d 79 2f 00 00    lea    0x2f79(%rip),%rdi        # 4010 <__TMC_END__>
1097:       48 8d 05 72 2f 00 00    lea    0x2f72(%rip),%rax        # 4010 <__TMC_END__>
109e:       48 39 f8                cmp    %rdi,%rax
10a1:       74 15                   je     10b8 <deregister_tm_clones+0x28>
10a3:       48 8b 05 36 2f 00 00    mov    0x2f36(%rip),%rax        # 3fe0 <_ITM_deregisterTMCloneTable@Base>
10aa:       48 85 c0                test   %rax,%rax
10ad:       74 09                   je     10b8 <deregister_tm_clones+0x28>
10af:       ff e0                   jmp    *%rax
10b1:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
10b8:       c3                      ret
10b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000000010c0 <register_tm_clones>:
register_tm_clones():
10c0:       48 8d 3d 49 2f 00 00    lea    0x2f49(%rip),%rdi        # 4010 <__TMC_END__>
10c7:       48 8d 35 42 2f 00 00    lea    0x2f42(%rip),%rsi        # 4010 <__TMC_END__>
10ce:       48 29 fe                sub    %rdi,%rsi
10d1:       48 89 f0                mov    %rsi,%rax
10d4:       48 c1 ee 3f             shr    $0x3f,%rsi
10d8:       48 c1 f8 03             sar    $0x3,%rax
10dc:       48 01 c6                add    %rax,%rsi
10df:       48 d1 fe                sar    %rsi
10e2:       74 14                   je     10f8 <register_tm_clones+0x38>
10e4:       48 8b 05 05 2f 00 00    mov    0x2f05(%rip),%rax        # 3ff0 <_ITM_registerTMCloneTable@Base>
10eb:       48 85 c0                test   %rax,%rax
10ee:       74 08                   je     10f8 <register_tm_clones+0x38>
10f0:       ff e0                   jmp    *%rax
10f2:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
10f8:       c3                      ret
10f9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001100 <__do_global_dtors_aux>:
__do_global_dtors_aux():
1100:       f3 0f 1e fa             endbr64
1104:       80 3d 05 2f 00 00 00    cmpb   $0x0,0x2f05(%rip)        # 4010 <__TMC_END__>
110b:       75 2b                   jne    1138 <__do_global_dtors_aux+0x38>
110d:       55                      push   %rbp
110e:       48 83 3d e2 2e 00 00    cmpq   $0x0,0x2ee2(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
1115:       00
1116:       48 89 e5                mov    %rsp,%rbp
1119:       74 0c                   je     1127 <__do_global_dtors_aux+0x27>
111b:       48 8b 3d e6 2e 00 00    mov    0x2ee6(%rip),%rdi        # 4008 <__dso_handle>
1122:       e8 19 ff ff ff          call   1040 <__cxa_finalize@plt>
1127:       e8 64 ff ff ff          call   1090 <deregister_tm_clones>
112c:       c6 05 dd 2e 00 00 01    movb   $0x1,0x2edd(%rip)        # 4010 <__TMC_END__>
1133:       5d                      pop    %rbp
1134:       c3                      ret
1135:       0f 1f 00                nopl   (%rax)
1138:       c3                      ret
1139:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001140 <frame_dummy>:
frame_dummy():
1140:       f3 0f 1e fa             endbr64
1144:       e9 77 ff ff ff          jmp    10c0 <register_tm_clones>

0000000000001149 <main>:
main():
/home/guochaoxxl/tmp/study.c:7
1149:       f3 0f 1e fa             endbr64
114d:       55                      push   %rbp
114e:       48 89 e5                mov    %rsp,%rbp
1151:       48 83 ec 20             sub    $0x20,%rsp
1155:       89 7d ec                mov    %edi,-0x14(%rbp)
1158:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
/home/guochaoxxl/tmp/study.c:11
115c:       c7 45 f4 01 00 00 00    movl   $0x1,-0xc(%rbp)
/home/guochaoxxl/tmp/study.c:12
1163:       c7 45 f8 02 00 00 00    movl   $0x2,-0x8(%rbp)
/home/guochaoxxl/tmp/study.c:13
116a:       8b 55 f4                mov    -0xc(%rbp),%edx
116d:       8b 45 f8                mov    -0x8(%rbp),%eax
1170:       01 d0                   add    %edx,%eax
1172:       89 45 fc                mov    %eax,-0x4(%rbp)
/home/guochaoxxl/tmp/study.c:15
1175:       8b 45 fc                mov    -0x4(%rbp),%eax
1178:       89 c6                   mov    %eax,%esi
117a:       48 8d 05 83 0e 00 00    lea    0xe83(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
1181:       48 89 c7                mov    %rax,%rdi
1184:       b8 00 00 00 00          mov    $0x0,%eax
1189:       e8 c2 fe ff ff          call   1050 <printf@plt>
/home/guochaoxxl/tmp/study.c:17
118e:       b8 00 00 00 00          mov    $0x0,%eax
/home/guochaoxxl/tmp/study.c:18
1193:       c9                      leave
1194:       c3                      ret

Disassembly of section .fini:

0000000000001198 <_fini>:
_fini():
1198:       f3 0f 1e fa             endbr64
119c:       48 83 ec 08             sub    $0x8,%rsp
11a0:       48 83 c4 08             add    $0x8,%rsp
11a4:       c3                      ret

反汇编section=.text段

objdump -d --section=.text study

study:     file format elf64-x86-64


Disassembly of section .text:

0000000000001060 <_start>:
1060:       f3 0f 1e fa             endbr64
1064:       31 ed                   xor    %ebp,%ebp
1066:       49 89 d1                mov    %rdx,%r9
1069:       5e                      pop    %rsi
106a:       48 89 e2                mov    %rsp,%rdx
106d:       48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
1071:       50                      push   %rax
1072:       54                      push   %rsp
1073:       45 31 c0                xor    %r8d,%r8d
1076:       31 c9                   xor    %ecx,%ecx
1078:       48 8d 3d ca 00 00 00    lea    0xca(%rip),%rdi        # 1149 <main>
107f:       ff 15 53 2f 00 00       call   *0x2f53(%rip)        # 3fd8 <__libc_start_main@GLIBC_2.34>
1085:       f4                      hlt
1086:       66 2e 0f 1f 84 00 00    cs nopw 0x0(%rax,%rax,1)
108d:       00 00 00

0000000000001090 <deregister_tm_clones>:
1090:       48 8d 3d 79 2f 00 00    lea    0x2f79(%rip),%rdi        # 4010 <__TMC_END__>
1097:       48 8d 05 72 2f 00 00    lea    0x2f72(%rip),%rax        # 4010 <__TMC_END__>
109e:       48 39 f8                cmp    %rdi,%rax
10a1:       74 15                   je     10b8 <deregister_tm_clones+0x28>
10a3:       48 8b 05 36 2f 00 00    mov    0x2f36(%rip),%rax        # 3fe0 <_ITM_deregisterTMCloneTable@Base>
10aa:       48 85 c0                test   %rax,%rax
10ad:       74 09                   je     10b8 <deregister_tm_clones+0x28>
10af:       ff e0                   jmp    *%rax
10b1:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
10b8:       c3                      ret
10b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000000010c0 <register_tm_clones>:
10c0:       48 8d 3d 49 2f 00 00    lea    0x2f49(%rip),%rdi        # 4010 <__TMC_END__>
10c7:       48 8d 35 42 2f 00 00    lea    0x2f42(%rip),%rsi        # 4010 <__TMC_END__>
10ce:       48 29 fe                sub    %rdi,%rsi
10d1:       48 89 f0                mov    %rsi,%rax
10d4:       48 c1 ee 3f             shr    $0x3f,%rsi
10d8:       48 c1 f8 03             sar    $0x3,%rax
10dc:       48 01 c6                add    %rax,%rsi
10df:       48 d1 fe                sar    %rsi
10e2:       74 14                   je     10f8 <register_tm_clones+0x38>
10e4:       48 8b 05 05 2f 00 00    mov    0x2f05(%rip),%rax        # 3ff0 <_ITM_registerTMCloneTable@Base>
10eb:       48 85 c0                test   %rax,%rax
10ee:       74 08                   je     10f8 <register_tm_clones+0x38>
10f0:       ff e0                   jmp    *%rax
10f2:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
10f8:       c3                      ret
10f9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001100 <__do_global_dtors_aux>:
1100:       f3 0f 1e fa             endbr64
1104:       80 3d 05 2f 00 00 00    cmpb   $0x0,0x2f05(%rip)        # 4010 <__TMC_END__>
110b:       75 2b                   jne    1138 <__do_global_dtors_aux+0x38>
110d:       55                      push   %rbp
110e:       48 83 3d e2 2e 00 00    cmpq   $0x0,0x2ee2(%rip)        # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
1115:       00
1116:       48 89 e5                mov    %rsp,%rbp
1119:       74 0c                   je     1127 <__do_global_dtors_aux+0x27>
111b:       48 8b 3d e6 2e 00 00    mov    0x2ee6(%rip),%rdi        # 4008 <__dso_handle>
1122:       e8 19 ff ff ff          call   1040 <__cxa_finalize@plt>
1127:       e8 64 ff ff ff          call   1090 <deregister_tm_clones>
112c:       c6 05 dd 2e 00 00 01    movb   $0x1,0x2edd(%rip)        # 4010 <__TMC_END__>
1133:       5d                      pop    %rbp
1134:       c3                      ret
1135:       0f 1f 00                nopl   (%rax)
1138:       c3                      ret
1139:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000001140 <frame_dummy>:
1140:       f3 0f 1e fa             endbr64
1144:       e9 77 ff ff ff          jmp    10c0 <register_tm_clones>

0000000000001149 <main>:
1149:       f3 0f 1e fa             endbr64
114d:       55                      push   %rbp
114e:       48 89 e5                mov    %rsp,%rbp
1151:       48 83 ec 20             sub    $0x20,%rsp
1155:       89 7d ec                mov    %edi,-0x14(%rbp)
1158:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
115c:       c7 45 f4 01 00 00 00    movl   $0x1,-0xc(%rbp)
1163:       c7 45 f8 02 00 00 00    movl   $0x2,-0x8(%rbp)
116a:       8b 55 f4                mov    -0xc(%rbp),%edx
116d:       8b 45 f8                mov    -0x8(%rbp),%eax
1170:       01 d0                   add    %edx,%eax
1172:       89 45 fc                mov    %eax,-0x4(%rbp)
1175:       8b 45 fc                mov    -0x4(%rbp),%eax
1178:       89 c6                   mov    %eax,%esi
117a:       48 8d 05 83 0e 00 00    lea    0xe83(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
1181:       48 89 c7                mov    %rax,%rdi
1184:       b8 00 00 00 00          mov    $0x0,%eax
1189:       e8 c2 fe ff ff          call   1050 <printf@plt>
118e:       b8 00 00 00 00          mov    $0x0,%eax
1193:       c9                      leave
1194:       c3                      ret

反汇编.data段

objdump -d --section=.data study

study:     file format elf64-x86-64


Disassembly of section .data:

0000000000004000 <__data_start>:
...

0000000000004008 <__dso_handle>:
4008:       08 40 00 00 00 00 00 00                             .@......

显示目标文件各个段的头部摘要信息:

objdump -h study

study:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
0 .interp       0000001c  0000000000000318  0000000000000318  00000318  2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .note.gnu.property 00000030  0000000000000338  0000000000000338  00000338  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .note.gnu.build-id 00000024  0000000000000368  0000000000000368  00000368  2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .note.ABI-tag 00000020  000000000000038c  000000000000038c  0000038c  2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.hash     00000024  00000000000003b0  00000000000003b0  000003b0  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .dynsym       000000a8  00000000000003d8  00000000000003d8  000003d8  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .dynstr       0000008f  0000000000000480  0000000000000480  00000480  2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .gnu.version  0000000e  0000000000000510  0000000000000510  00000510  2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .gnu.version_r 00000030  0000000000000520  0000000000000520  00000520  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .rela.dyn     000000c0  0000000000000550  0000000000000550  00000550  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .rela.plt     00000018  0000000000000610  0000000000000610  00000610  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
11 .init         0000001b  0000000000001000  0000000000001000  00001000  2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .plt          00000020  0000000000001020  0000000000001020  00001020  2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .plt.got      00000010  0000000000001040  0000000000001040  00001040  2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .plt.sec      00000010  0000000000001050  0000000000001050  00001050  2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
15 .text         00000135  0000000000001060  0000000000001060  00001060  2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
16 .fini         0000000d  0000000000001198  0000000000001198  00001198  2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
17 .rodata       00000012  0000000000002000  0000000000002000  00002000  2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
18 .eh_frame_hdr 00000034  0000000000002014  0000000000002014  00002014  2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
19 .eh_frame     000000ac  0000000000002048  0000000000002048  00002048  2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
20 .init_array   00000008  0000000000003db8  0000000000003db8  00002db8  2**3
CONTENTS, ALLOC, LOAD, DATA
21 .fini_array   00000008  0000000000003dc0  0000000000003dc0  00002dc0  2**3
CONTENTS, ALLOC, LOAD, DATA
22 .dynamic      000001f0  0000000000003dc8  0000000000003dc8  00002dc8  2**3
CONTENTS, ALLOC, LOAD, DATA
23 .got          00000048  0000000000003fb8  0000000000003fb8  00002fb8  2**3
CONTENTS, ALLOC, LOAD, DATA
24 .data         00000010  0000000000004000  0000000000004000  00003000  2**3
CONTENTS, ALLOC, LOAD, DATA
25 .bss          00000008  0000000000004010  0000000000004010  00003010  2**0
ALLOC
26 .comment      0000002b  0000000000000000  0000000000000000  00003010  2**0
CONTENTS, READONLY
27 .debug_aranges 00000030  0000000000000000  0000000000000000  0000303b  2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
28 .debug_info   000000f8  0000000000000000  0000000000000000  0000306b  2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
29 .debug_abbrev 000000a1  0000000000000000  0000000000000000  00003163  2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
30 .debug_line   00000062  0000000000000000  0000000000000000  00003204  2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
31 .debug_str    000000ea  0000000000000000  0000000000000000  00003266  2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
32 .debug_line_str 00000032  0000000000000000  0000000000000000  00003350  2**0
CONTENTS, READONLY, DEBUGGING, OCTETS

 

posted @ 2024-01-02 10:11  叕叒双又  阅读(184)  评论(4编辑  收藏  举报