I ran objdump -r
on an object file and got the following output. What do each of the columns represent here? I might have missed it, but the documentation doesn't specify.
simple.o: file format elf64-x86-64
Disassembly of section .text:
0000000000开发者_开发知识库000000 <main>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 83 ec 30 sub $0x30,%rsp
8: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
f: 00 00
11: 48 89 45 f8 mov %rax,-0x8(%rbp)
15: 31 c0 xor %eax,%eax
17: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%rbp)
1e: eb 64 jmp 84 <main+0x84>
20: 8b 45 d8 mov -0x28(%rbp),%eax
23: 89 c7 mov %eax,%edi
25: e8 00 00 00 00 callq 2a <main+0x2a>
26: R_X86_64_PC32 foo-0x4
2a: 89 45 dc mov %eax,-0x24(%rbp)
2d: 8b 55 dc mov -0x24(%rbp),%edx
30: 48 8d 45 e0 lea -0x20(%rbp),%rax
etc
Isn't it self explanatory:
Offset, Machine code, Corresponding Assembly code
As remained by Peter Cordes, there is a tiny difference on different OS.
link : https://stackoverflow.com/a/67618638/575842
精彩评论