1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
| $ objdump -s -d hello.o # linux-arm hello.o: file format elf32-littlearm
Contents of section .text: 0000 00482de9 04b08de2 08d04de2 08000be5 .H-.......M..... 0010 08101be5 0c009fe5 feffffeb 0000a0e1 ................ 0020 04d04be2 0088bde8 00000000 00482de9 ..K..........H-. 0030 04b08de2 08d04de2 0130a0e3 08300be5 ......M..0...0.. 0040 08201be5 0c301be5 033082e0 0300a0e1 . ...0...0...... 0050 feffffeb 0c301be5 0300a0e1 04d04be2 .....0........K. 0060 0088bde8 .... Contents of section .data: 0000 a5000000 5a000000 ....Z... Contents of section .rodata: 0000 256c640a 00 %ld.. Contents of section .comment: 0000 00474343 3a202852 61737062 69616e20 .GCC: (Raspbian 0010 382e332e 302d362b 72706931 2920382e 8.3.0-6+rpi1) 8. 0020 332e3000 3.0. Contents of section .ARM.attributes: 0000 412e0000 00616561 62690001 24000000 A....aeabi..$... 0010 05360006 06080109 010a0212 04140115 .6.............. 0020 01170318 0119011a 021c011e 062201 .............".
Disassembly of section .text:
00000000 <foo>: 0: e92d4800 push {fp, lr} 4: e28db004 add fp, sp, #4 8: e24dd008 sub sp, sp, #8 c: e50b0008 str r0, [fp, #-8] 10: e51b1008 ldr r1, [fp, #-8] 14: e59f000c ldr r0, [pc, #12] ; 28 <foo+0x28> 18: ebfffffe bl 0 <printf> 1c: e1a00000 nop ; (mov r0, r0) 20: e24bd004 sub sp, fp, #4 24: e8bd8800 pop {fp, pc} 28: 00000000 .word 0x00000000
0000002c <main>: 2c: e92d4800 push {fp, lr} 30: e28db004 add fp, sp, #4 34: e24dd008 sub sp, sp, #8 38: e3a03001 mov r3, #1 3c: e50b3008 str r3, [fp, #-8] 40: e51b2008 ldr r2, [fp, #-8] 44: e51b300c ldr r3, [fp, #-12] 48: e0823003 add r3, r2, r3 4c: e1a00003 mov r0, r3 50: ebfffffe bl 0 <foo> 54: e51b300c ldr r3, [fp, #-12] 58: e1a00003 mov r0, r3 5c: e24bd004 sub sp, fp, #4 60: e8bd8800 pop {fp, pc}
$ objdump -s -d hello.o # macOS-x64 hello.o: file format Mach-O 64-bit x86-64
Contents of section __text: 0000 554889e5 4883ec10 897dfc8b 75fc488d UH..H....}..u.H. 0010 3d4f0000 00b000e8 00000000 4883c410 =O..........H... 0020 5dc3662e 0f1f8400 00000000 0f1f4000 ].f...........@. 0030 554889e5 4883ec10 c745fc00 000000c7 UH..H....E...... 0040 45f80100 00008b45 f80345f4 89c7e800 E......E..E..... 0050 0000008b 45f44883 c4105dc3 ....E.H...]. Contents of section __data: 005c a5000000 5a000000 ....Z... Contents of section __cstring: 0064 25640a00 %d.. Contents of section __compact_unwind: 0068 00000000 00000000 22000000 00000001 ........"....... 0078 00000000 00000000 00000000 00000000 ................ 0088 30000000 00000000 2c000000 00000001 0.......,....... 0098 00000000 00000000 00000000 00000000 ................ Contents of section __eh_frame: 00a8 14000000 00000000 017a5200 01781001 .........zR..x.. 00b8 100c0708 90010000 24000000 1c000000 ........$....... 00c8 38ffffff ffffffff 22000000 00000000 8......."....... 00d8 00410e10 8602430d 06000000 00000000 .A....C......... 00e8 24000000 44000000 40ffffff ffffffff $...D...@....... 00f8 2c000000 00000000 00410e10 8602430d ,........A....C. 0108 06000000 00000000 ........
Disassembly of section __TEXT,__text:
0000000000000000 _foo: 0: 55 pushq %rbp 1: 48 89 e5 movq %rsp, %rbp 4: 48 83 ec 10 subq $16, %rsp 8: 89 7d fc movl %edi, -4(%rbp) b: 8b 75 fc movl -4(%rbp), %esi e: 48 8d 3d 4f 00 00 00 leaq 79(%rip), %rdi 15: b0 00 movb $0, %al 17: e8 00 00 00 00 callq 0 <_foo+0x1c> 1c: 48 83 c4 10 addq $16, %rsp 20: 5d popq %rbp 21: c3 retq 22: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax) 2c: 0f 1f 40 00 nopl (%rax)
0000000000000030 _main: 30: 55 pushq %rbp 31: 48 89 e5 movq %rsp, %rbp 34: 48 83 ec 10 subq $16, %rsp 38: c7 45 fc 00 00 00 00 movl $0, -4(%rbp) 3f: c7 45 f8 01 00 00 00 movl $1, -8(%rbp) 46: 8b 45 f8 movl -8(%rbp), %eax 49: 03 45 f4 addl -12(%rbp), %eax 4c: 89 c7 movl %eax, %edi 4e: e8 00 00 00 00 callq 0 <_main+0x23> 53: 8b 45 f4 movl -12(%rbp), %eax 56: 48 83 c4 10 addq $16, %rsp 5a: 5d popq %rbp 5b: c3 retq
|