目标文件
反汇编:
gcc -c -o main.o main.c
objdump -s -d main.o > main.o.txt
查看汇编文件:
main.o: 文件格式 elf64-x86-64
Contents of section .text:
0000 554889e5 8b050000 000083c0 01890500 UH..............
0010 0000008b 05000000 0089c6bf 00000000 ................
0020 b8000000 00e80000 0000b800 0000005d ...............]
0030 c3 .
Contents of section .data:
0000 01000000 ....
Contents of section .rodata:
0000 25640a00 %d..
Contents of section .comment:
0000 00474343 3a202855 62756e74 7520342e .GCC: (Ubuntu 4.
0010 382e322d 31397562 756e7475 31292034 8.2-19ubuntu1) 4
0020 2e382e32 00 .8.2.
Contents of section .eh_frame:
0000 14000000 00000000 017a5200 01781001 .........zR..x..
0010 1b0c0708 90010000 1c000000 1c000000 ................
0020 00000000 31000000 00410e10 8602430d ....1....A....C.
0030 066c0c07 08000000 .l......
Disassembly of section .text:
0000000000000000 <main>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 8b 05 00 00 00 00 mov 0x0(%rip),%eax # a <main+0xa>
a: 83 c0 01 add $0x1,%eax
d: 89 05 00 00 00 00 mov %eax,0x0(%rip) # 13 <main+0x13>
13: 8b 05 00 00 00 00 mov 0x0(%rip),%eax # 19 <main+0x19>
19: 89 c6 mov %eax,%esi
1b: bf 00 00 00 00 mov $0x0,%edi
20: b8 00 00 00 00 mov $0x0,%eax
25: e8 00 00 00 00 callq 2a <main+0x2a>
2a: b8 00 00 00 00 mov $0x0,%eax
2f: 5d pop %rbp
30: c3 retq