1 test1.o: file format elf64-x86-64
3 Contents of section .text:
4 0000 554889e5 4883ec10 897dfc8b 45fc89c6 UH..H....}..E...
5 0010 bf000000 00b80000 0000e800 000000c9 ................
6 0020 c3554889 e54883ec 10c745fc 01000000 .UH..H....E.....
7 0030 8b150000 00008b05 00000000 01c28b45 ...............E
8 0040 fc01c28b 45f801d0 89c7e800 0000008b ....E...........
9 0050 45fcc9c3 E...
10 Contents of section .data:
11 0000 54000000 55000000 T...U...
12 Contents of section .rodata:
13 0000 25640a00 %d..
14 Contents of section .comment:
15 0000 00474343 3a202847 4e552920 342e382e .GCC: (GNU) 4.8.
16 0010 35203230 31353036 32332028 52656420 5 20150623 (Red
17 0020 48617420 342e382e 352d3336 2900 Hat 4.8.5-36).
18 Contents of section .eh_frame:
19 0000 14000000 00000000 017a5200 01781001 .........zR..x..
20 0010 1b0c0708 90010000 1c000000 1c000000 ................
21 0020 00000000 21000000 00410e10 8602430d ....!....A....C.
22 0030 065c0c07 08000000 1c000000 3c000000 .\..........<...
23 0040 00000000 33000000 00410e10 8602430d ....3....A....C.
24 0050 066e0c07 08000000 .n......
26 Disassembly of section .text:
28 0000000000000000 <func1>:
29 0: 55 push %rbp
30 1: 48 89 e5 mov %rsp,%rbp
31 4: 48 83 ec 10 sub $0x10,%rsp
32 8: 89 7d fc mov %edi,-0x4(%rbp)
33 b: 8b 45 fc mov -0x4(%rbp),%eax
34 e: 89 c6 mov %eax,%esi
35 10: bf 00 00 00 00 mov $0x0,%edi
36 15: b8 00 00 00 00 mov $0x0,%eax
37 1a: e8 00 00 00 00 callq 1f <func1+0x1f>
38 1f: c9 leaveq
39 20: c3 retq
41 0000000000000021 <main>:
42 21: 55 push %rbp
43 22: 48 89 e5 mov %rsp,%rbp
44 25: 48 83 ec 10 sub $0x10,%rsp
45 29: c7 45 fc 01 00 00 00 movl $0x1,-0x4(%rbp)
46 30: 8b 15 00 00 00 00 mov 0x0(%rip),%edx # 36 <main+0x15>
47 36: 8b 05 00 00 00 00 mov 0x0(%rip),%eax # 3c <main+0x1b>
48 3c: 01 c2 add %eax,%edx
49 3e: 8b 45 fc mov -0x4(%rbp),%eax
50 41: 01 c2 add %eax,%edx
51 43: 8b 45 f8 mov -0x8(%rbp),%eax
52 46: 01 d0 add %edx,%eax
53 48: 89 c7 mov %eax,%edi
54 4a: e8 00 00 00 00 callq 4f <main+0x2e>
55 4f: 8b 45 fc mov -0x4(%rbp),%eax
56 52: c9 leaveq
57 53: c3 retq
.bss 00000004 0000000000000000 0000000000000000 0000009c 2**2
00000004=4字节 代码global_uninit_var; static int static_var2; 前面4个字节但是这里有2个变量,显然有问题。实际在.bss段中只有static_var2。查看 SYMBOL TABLE 发现global_uninit_var没有存在任何地方 只是一个*COM*符号,这其实跟不同的语言与不同编译器有关系,有些编译器会将未初始化全局变量放在.bss中