试试看:
$ cc -c test.c$ objcopy -O binary test.o binfile
您可以使用来确保它是正确的
objdump:
$ objdump -d test.o test.o: file format pe-i386Disassembly of section .text:00000000 <_f>: 0: 55push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 04 sub $0x4,%esp 6: 8b 45 08 mov 0x8(%ebp),%eax 9: 0f af 45 08 imul 0x8(%ebp),%eax d: 89 45 fc mov %eax,-0x4(%ebp) 10: 8b 45 fc mov -0x4(%ebp),%eax 13: 83 c0 02 add $0x2,%eax 16: c9leave 17: c3ret
并与二进制文件进行比较:
$ hexdump -C binfile 00000000 55 89 e5 83 ec 04 8b 45 08 0f af 45 08 89 45 fc |U......E...E..E.|00000010 8b 45 fc 83 c0 02 c9 c3 |.E......|00000018



