ILLINK -- Microsoft (R) .NET Framework IL Linker, Version 1.0
--------------------------------------------------------------
The ILLINK utility is intended for linking multiple managed modules or assemblies into a single
module or assembly. The utility relies on round-tripping using the ILASM and ILDASM utilities and
is not able to link the modules containing embedded native code. Only pure-IL modules, such as
those generated by C#, VB.NET or ILASM compilers, can be linked.
The general principle of the ILLINK functioning is the corrective round-tripping. The modules
being linked are disassembled into IL Assembly language source text, the text is processed and
then re-assembled into a single module. The text processing includes the following:
- removal of multiple assembly and module declarations;
- removal of assembly references, module references and file references pertinent to the modules
being linked;
- removal of exported type declarations pertinent to the modules being linked;
- removal of class reference resolution scopes pertinent to the modules being linked;
- renaming of data labels in order to avoid same-name labels originating from different modules
being linked;
- renumbering of the VTableFixup table entries and export ordinals for the managed methods exposed
as unmanaged exports.
The following special cases are not covered by the ILLINK processing and will lead to link failure:
- presence of same-name, same-signature global methods or fields in the modules being linked;
- presence of the classes with identical full names in the modules being linked; such classes are
interpreted by the ILASM as augmentation of the same class, and the result is unpredictable.
The ILLINK is a console application. The command line structure is as follows:
illink <files_being_linked> /out=<linked_file> [<options>]
The names of files being linked must maintain casing of respective modules or assemblies. For
example, if you link assembly System.Windows.Forms, specify it as System.Windows.Forms.dll
Options:
/RESOURCE=<res_file> -- Link the specified Win32 resource file (*.res) into the resulting module;
If this option is not specified, ILLINK will use the resource file
(if any) extracted from the first module being linked.
/DEBUG -- Include debug information. If the modules being linked have the debug
information (local variable names, line-to-code bindings, etc.), and
are linked with /DEBUG option, the resulting module will retain the
original debug information;
/PRESERVE -- Don't delete the intermediate files and temporary directory
'illinktempdir'on exit;
/KEY=<keyfile> -- Link with strong name signature (<keyfile> contains private key);
/KEY=@<keysource> -- Link with strong name signature (<keysource> is the private key
source name);
/SUBSYSTEM=<int> -- Set Subsystem value in the NT Optional header;
/FLAGS=<int> -- Set CLR ImageFlags value in the CLR header;
/ALIGNMENT=<int> -- Set FileAlignment value in the NT Optional header;
/BASE=<int> -- Set ImageBase value in the NT Optional header.
Option key may be '-' or '/'. Options are recognized by first 3 characters and are case-insensitive.
Symbols '=' and ':' in options are interchangeable. Thus, the following options are equivalent:
/RESOURCE=MyRes.res
/RES=MyRes.res
-res:MyRes.res
评论0