Understanding the Microsoft Intermediate Language
page 9 of 12
by Joydip Kanjilal
Feedback
Average Rating: 
Views (Total / Last 10 Days): 51989/ 178

Portable Executable Files and Common Object File Format

The MSIL and metadata of it are contained in a portable executable (PE) file. The term "PE" implies "Portable Executable," which came into being with the intent of having a common file format for all flavors of Windows Operating Systems on all supported CPU's. This is based on and the Common Object File Format (COFF). This file format, which accommodates MSIL or native code as well as metadata, enables the operating system to recognize common language runtime images. The presence of metadata in the file along with the MSIL makes the code self-describing, therefore, eliminating the need for type libraries or Interface Definition Language (IDL). At runtime, the metadata is read as and when it is needed for execution.

When a program targeted at the CLR is compiled, it generates MSIL code which is in turn stored in a Portable Executable (PE) format. The Portable Executable (PE) format (based on COFF) specifies a portable file format for executables, object code, and DLLs that are used in Windows operating systems. In order to make them portable across all 32-bit and 64 - bit Windows Operating Systems, all .NET assemblies are actually portable executable or PE files. The code, metadata and resources of the MSIL are actually stored in a data section in the PE file. The following is the layout of a PE file (also known as an Image file) in the COFF format.

Listing 3: The PE File Structure


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-03-05 9:10:44 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search