D:\Program Files\Microsoft Visual Studio\VC98\Bin>dumpbin /headers link.exe
Microsoft (R) COFF Binary File Dumper Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
Dump of file link.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
14C machine (i386)
3 number of sections
36F795EF time date stamp Tue Mar 23 21:23:59 1999
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
10F characteristics
Relocations stripped
Executable
Line numbers stripped
Symbols stripped
32 bit word machine
OPTIONAL HEADER VALUES
10B magic #
6.00 linker version
68000 size of code
35000 size of initialized data
0 size of uninitialized data
67FAF RVA of entry point
1000 base of code
69000 base of data
400000 image base
1000 section alignment
1000 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
9E000 size of image
1000 size of headers
0 checksum
3 subsystem (Windows CUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
0 [ 0] RVA [size] of Export Directory
68548 [ 50] RVA [size] of Import Directory
97000 [ 6F78] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
0 [ 0] RVA [size] of Base Relocation Directory
1280 [ 1C] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Special Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
1000 [ 278] RVA [size] of Import Address Table Directory
68328 [ 60] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of Reserved Directory
0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1
.text name
67FF2 virtual size
1000 virtual address
68000 size of raw data
1000 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read
SECTION HEADER #2
.data name
2D958 virtual size
69000 virtual address
1000 size of raw data
69000 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write
SECTION HEADER #3
.rsrc name
6F78 virtual size
97000 virtual address
7000 size of raw data
6A000 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
68000 size of code
35000 size of initialized data
0 size of uninitialized data
这里写着未初始化数据的大小是0。
而在.data节中:
SECTION HEADER #2
.data name
2D958 virtual size
69000 virtual address
1000 size of raw data
69000 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write
从这里可以看到:
virtual size = 2D958,
size of raw data = 1000;
virtual size > size of raw data。
virtual size > size of raw data,这不是说明.data这个节含有未初始化的数据吗?