我一直在做一项练习,试图了解程序背后发生的一些事情。我编写了一个小型 C 程序,并在 i386 Linux (Ubuntu 12.04) 上使用gcc
.然后我hexdump -C
对输出到文本文件进行了操作。我注意到偏移量上有一些间隙*
:
00000670 00 3f 1a 3b 2a 32 24 22 1c 00 00 00 40 00 00 00 |.?.;*2$"....@...|
00000680 94 fd ff ff 05 01 00 00 00 41 0e 08 85 02 42 0d |.........A....B.|
00000690 05 03 01 01 c5 0c 04 04 38 00 00 00 60 00 00 00 |........8...`...|
000006a0 80 fe ff ff 61 00 00 00 00 41 0e 08 85 02 41 0e |....a....A....A.|
000006b0 0c 87 03 41 0e 10 86 04 41 0e 14 83 05 4e 0e 30 |...A....A....N.0|
000006c0 02 4a 0e 14 41 0e 10 c3 41 0e 0c c6 41 0e 08 c7 |.J..A...A...A...|
000006d0 41 0e 04 c5 10 00 00 00 9c 00 00 00 b4 fe ff ff |A...............|
000006e0 02 00 00 00 00 00 00 00 10 00 00 00 b0 00 00 00 |................|
000006f0 a2 fe ff ff 04 00 00 00 00 00 00 00 00 00 00 00 |................|
00000700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000f10 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff |................|
00000f20 00 00 00 00 00 00 00 00 01 00 00 00 10 00 00 00 |................|
00000f30 0c 00 00 00 d4 82 04 08 0d 00 00 00 cc 85 04 08 |................|
00000f40 f5 fe ff 6f ac 81 04 08 05 00 00 00 2c 82 04 08 |...o........,...|
00000f50 06 00 00 00 cc 81 04 08 0a 00 00 00 54 00 00 00 |............T...|
00000f60 0b 00 00 00 10 00 00 00 15 00 00 00 00 00 00 00 |................|
00000f70 03 00 00 00 f4 9f 04 08 02 00 00 00 20 00 00 00 |............ ...|
00000f80 14 00 00 00 11 00 00 00 17 00 00 00 b4 82 04 08 |................|
00000f90 11 00 00 00 ac 82 04 08 12 00 00 00 08 00 00 00 |................|
00000fa0 13 00 00 00 08 00 00 00 fe ff ff 6f 8c 82 04 08 |...........o....|
00000fb0 ff ff ff 6f 01 00 00 00 f0 ff ff 6f 80 82 04 08 |...o.......o....|
00000fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000ff0 00 00 00 00 28 9f 04 08 00 00 00 00 00 00 00 00 |....(...........|
00001000 26 83 04 08 36 83 04 08 46 83 04 08 56 83 04 08 |&...6...F...V...|
00001010 00 00 00 00 00 00 00 00 47 43 43 3a 20 28 55 62 |........GCC: (Ub|
00001020 75 6e 74 75 2f 4c 69 6e 61 72 6f 20 34 2e 36 2e |untu/Linaro 4.6.|
00001030 33 2d 31 75 62 75 6e 74 75 35 29 20 34 2e 36 2e |3-1ubuntu5) 4.6.|
00001040 33 00 00 2e 73 79 6d 74 61 62 00 2e 73 74 72 74 |3...symtab..strt|
00001050 61 62 00 2e 73 68 73 74 72 74 61 62 00 2e 69 6e |ab..shstrtab..in|
00001060 74 65 72 70 00 2e 6e 6f 74 65 2e 41 42 49 2d 74 |terp..note.ABI-t|
00001070 61 67 00 2e 6e 6f 74 65 2e 67 6e 75 2e 62 75 69 |ag..note.gnu.bui|
00001080 6c 64 2d 69 64 00 2e 67 6e 75 2e 68 61 73 68 00 |ld-id..gnu.hash.|
00001090 2e 64 79 6e 73 79 6d 00 2e 64 79 6e 73 74 72 00 |.dynsym..dynstr.|
我的问题是,我应该如何解释*
?我认为这意味着文件中存在间隙,但问题就变成了为什么会存在间隙?这是 ELF 文件标准格式的一部分吗?
答案1
与标准od
命令 或一样hd
,这意味着所有省略的行与前一行相同。无论如何,您可以通过-v
让它显示这些行。从hexdump(1)
:
-v 选项使 hexdump 显示所有输入数据。如果没有 -v 选项,任意数量的输出行组(与紧邻的前一组输出行相同(输入偏移量除外))将被替换为由单个星号组成的行。