PE文件中各种Section的含义

本文详细介绍了PE文件的各种节及其用途,包括默认代码段.text、读写数据段.data、只读数据段.rdata等,并解释了这些节如何在链接过程中被处理。

   
转自http://hi.baidu.com/hardcorn/blog/item/0bc4d2ca55851843f21fe7ee.html


未能在MSDN上找到此表,有找到的通知一下,谢谢。

Name

Description

.text

The default code section.

.data

The default read/write data section. Global variables typically go here.

.rdata

The default read-only data section. String literals and C++/COM vtables are examples of items put into .rdata. 

.idata

The imports table. It has become common practice (either explicitly, or via linker default behavior) to merge the .idata section into another section, typically .rdata. By default, the linker only merges the .idata section into another section when creating a release mode executable.

.edata

The exports table. When creating an executable that exports APIs or data, the linker creates an .EXP file. The .EXP file contains an .edata section that's added into the final executable. Like the .idata section, the .edata section is often found merged into the .text or .rdata sections.

.rsrc

The resources. This section is read-only. However, it should not be named anything other than .rsrc, and should not be merged into other sections.

.bss

Uninitialized data. Rarely found in executables created with recent linkers. Instead, the VirtualSize of the executable's .data section is expanded to make enough room for uninitialized data.

.crt

Data added for supporting the C++ runtime (CRT). A good example is the function pointers that are used to call the constructors and destructors of static C++ objects. See the January 2001 Under The Hood column for details on this.

.tls

Data for supporting thread local storage variables declared with __declspec(thread). This includes the initial value of the data, as well as additional variables needed by the runtime.

.reloc

The base relocations in an executable. Base relocations are generally only needed for DLLs and not EXEs. In release mode, the linker doesn't emit base relocations for EXE files. Relocations can be removed when linking with the /FIXED switch.

.sdata

"Short" read/write data that can be addressed relative to the global pointer. Used for the IA-64 and other architectures that use a global pointer register. Regular-sized global variables on the IA-64 will go in this section.

.srdata

"Short" read-only data that can be addressed relative to the global pointer. Used on the IA-64 and other architectures that use a global pointer register.

.pdata

The exception table. Contains an array of IMAGE_RUNTIME_FUNCTION_ENTRY structures, which are CPU-specific. Pointed to by the IMAGE_DIRECTORY_ENTRY_EXCEPTION slot in the DataDirectory. Used for architectures with table-based exception handling, such as the IA-64. The only architecture that doesn't use table-based exception handling is the x86.

.debug$S

Codeview format symbols in the OBJ file. This is a stream of variable-length CodeView format symbol records.

.debug$T

Codeview format type records in the OBJ file. This is a stream of variable-length CodeView format type records.

.debug$P

Found in the OBJ file when using precompiled headers.

.drectve

Contains linker directives and is only found in OBJs. Directives are ASCII strings that could be passed on the linker command line. For instance:

-defaultlib:LIBC

Directives are separated by a space character.

.didat

Delayload import data. Found in executables built in nonrelease mode. In release mode, the delayload data is merged into another section.

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值