diff options
author | Ankit Jain <radical@corewars.org> | 2006-04-24 12:43:24 +0400 |
---|---|---|
committer | Ankit Jain <radical@corewars.org> | 2006-04-24 12:43:24 +0400 |
commit | 7f04a3171fea1718d01307432d5a6faff3b58dae (patch) | |
tree | d2719a597c759edf81ad0e53a7f4ef4195b75dc7 /mcs | |
parent | 6a795f3474c20d3143a45b5003f68d8cb0787bef (diff) |
In ilasm/tests:
* test-module.il: New. Test for a netmodule.
In ilasm/codegen:
* CodeGen.cs (CodeGen.ctor): Remove 'is_assembly' param.
(CodeGen.Write): Emit assembly manifest only if the source
had it.
In ilasm:
* Driver.cs (DriverMain.Run): Update use of CodeGen.ctor .
In class/PEAPI:
* PEAPI.cs (PEFile.WritePEFile): ReserveStrongNameSignatureSpace only if
we have assembly manifest.
svn path=/branches/mono-1-1-13/mcs/; revision=59797
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/PEAPI/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/PEAPI/PEAPI.cs | 3 | ||||
-rw-r--r-- | mcs/ilasm/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/ilasm/Driver.cs | 2 | ||||
-rw-r--r-- | mcs/ilasm/codegen/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/ilasm/codegen/CodeGen.cs | 16 | ||||
-rw-r--r-- | mcs/ilasm/tests/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/ilasm/tests/test-module.il | 40 |
8 files changed, 69 insertions, 11 deletions
diff --git a/mcs/class/PEAPI/ChangeLog b/mcs/class/PEAPI/ChangeLog index 98323b1b74c..dfdfaa5761c 100644 --- a/mcs/class/PEAPI/ChangeLog +++ b/mcs/class/PEAPI/ChangeLog @@ -1,3 +1,8 @@ +2006-04-24 Ankit Jain <jankit@novell.com> + + * PEAPI.cs (PEFile.WritePEFile): ReserveStrongNameSignatureSpace only if + we have assembly manifest. + 2006-02-22 Ankit Jain <jankit@novell.com> * Metadata.cs (TypeAttr): Add [Flags] attribute. diff --git a/mcs/class/PEAPI/PEAPI.cs b/mcs/class/PEAPI/PEAPI.cs index be8605c109b..21f26f32f14 100644 --- a/mcs/class/PEAPI/PEAPI.cs +++ b/mcs/class/PEAPI/PEAPI.cs @@ -972,7 +972,8 @@ namespace PEAPI { /// Write out the PEFile (the "bake" function) /// </summary> public void WritePEFile() { /* the "bake" function */ - fileImage.ReserveStrongNameSignatureSpace = thisAssembly.HasPublicKey; + if (thisAssembly != null) + fileImage.ReserveStrongNameSignatureSpace = thisAssembly.HasPublicKey; fileImage.MakeFile(); } diff --git a/mcs/ilasm/ChangeLog b/mcs/ilasm/ChangeLog index b075bfdb3c4..881df3aab99 100644 --- a/mcs/ilasm/ChangeLog +++ b/mcs/ilasm/ChangeLog @@ -1,3 +1,7 @@ +2006-04-24 Ankit Jain <jankit@novell.com> + + * Driver.cs (DriverMain.Run): Update use of CodeGen.ctor . + 2006-02-20 Ankit Jain <jankit@novell.com> * Report.cs (Report): Make all methods,fields static. diff --git a/mcs/ilasm/Driver.cs b/mcs/ilasm/Driver.cs index d4315f4c640..fe1d1450667 100644 --- a/mcs/ilasm/Driver.cs +++ b/mcs/ilasm/Driver.cs @@ -66,7 +66,7 @@ namespace Mono.ILASM { if (output_file == null) output_file = CreateOutputFilename (); try { - codegen = new CodeGen (output_file, target == Target.Dll, true, debugging_info); + codegen = new CodeGen (output_file, target == Target.Dll, debugging_info); foreach (string file_path in il_file_list) ProcessFile (file_path); if (scan_only) diff --git a/mcs/ilasm/codegen/ChangeLog b/mcs/ilasm/codegen/ChangeLog index c93e93ee92a..9c068fcded2 100644 --- a/mcs/ilasm/codegen/ChangeLog +++ b/mcs/ilasm/codegen/ChangeLog @@ -1,3 +1,9 @@ +2006-04-24 Ankit Jain <jankit@novell.com> + + * CodeGen.cs (CodeGen.ctor): Remove 'is_assembly' param. + (CodeGen.Write): Emit assembly manifest only if the source + had it. + 2006-02-22 Ankit Jain <jankit@novell.com> * ExternTable.cs (ExternTable.GetTypeRef): Emit a warning if mscorlib is diff --git a/mcs/ilasm/codegen/CodeGen.cs b/mcs/ilasm/codegen/CodeGen.cs index cabfe9b7f5d..8bff19022ff 100644 --- a/mcs/ilasm/codegen/CodeGen.cs +++ b/mcs/ilasm/codegen/CodeGen.cs @@ -68,17 +68,14 @@ namespace Mono.ILASM { private string output_file;
private string debug_file;
private bool is_dll;
- private bool is_assembly;
private bool entry_point;
private Module this_module;
- public CodeGen (string output_file, bool is_dll, bool is_assembly,
- bool debugging_info)
+ public CodeGen (string output_file, bool is_dll, bool debugging_info)
{
this.output_file = output_file;
this.is_dll = is_dll;
- this.is_assembly = is_assembly;
if (debugging_info)
symwriter = new SymbolWriter (CreateDebugFile (output_file));
@@ -492,7 +489,7 @@ namespace Mono.ILASM { this_module = new Module (Path.GetFileName (output_file));
out_stream = new FileStream (output_file, FileMode.Create, FileAccess.Write);
- pefile = new PEFile (assembly_name, ThisModule.Name, is_dll, is_assembly, null, out_stream);
+ pefile = new PEFile (assembly_name, ThisModule.Name, is_dll, assembly_name != null, null, out_stream);
PEAPI.Assembly asmb = pefile.GetThisAssembly ();
ThisModule.PeapiModule = pefile.GetThisModule ();
@@ -537,10 +534,11 @@ namespace Mono.ILASM { if (stack_reserve != -1)
pefile.SetStackReserve (stack_reserve);
- asmb.AddAssemblyInfo(assembly_major_version,
- assembly_minor_version, assembly_build_version,
- assembly_revision_version, assembly_public_key,
- (uint) assembly_hash_algorithm, assembly_locale);
+ if (asmb != null)
+ asmb.AddAssemblyInfo(assembly_major_version,
+ assembly_minor_version, assembly_build_version,
+ assembly_revision_version, assembly_public_key,
+ (uint) assembly_hash_algorithm, assembly_locale);
pefile.WritePEFile ();
diff --git a/mcs/ilasm/tests/ChangeLog b/mcs/ilasm/tests/ChangeLog index 4bff294d226..0aa4301b283 100644 --- a/mcs/ilasm/tests/ChangeLog +++ b/mcs/ilasm/tests/ChangeLog @@ -1,3 +1,7 @@ +2006-04-24 Ankit Jain <jankit@novell.com> + + * test-module.il: New. Test for a netmodule. + 2006-02-22 Ankit Jain <jankit@novell.com> * test-nonsealed-valueclass.il: New. Value class should be sealed. diff --git a/mcs/ilasm/tests/test-module.il b/mcs/ilasm/tests/test-module.il new file mode 100644 index 00000000000..20d4530dfee --- /dev/null +++ b/mcs/ilasm/tests/test-module.il @@ -0,0 +1,40 @@ +//Test for module, there is no Assembly manifest in +//this source file + +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. +} +.module a.netmodule // GUID = {CFF03797-0272-4E67-86D4-8C7263E398A4} + + + .class public auto ansi beforefieldinit A + extends [mscorlib]System.Object + { + + // method line 1 + .method public static hidebysig + default void foo () cil managed + { + // Method begins at RVA 0x2050 + // Code size 2 (0x2) + .maxstack 8 + IL_0000: nop + IL_0001: ret + } // end of method A::default void foo () + + // method line 2 + .method public hidebysig specialname rtspecialname + instance default void .ctor () cil managed + { + // Method begins at RVA 0x2053 + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void object::.ctor() + IL_0006: ret + } // end of method A::instance default void .ctor () + + } // end of class A + |