In some collection case, xsi:type is explicitly written. Try to copy that behavior.
[mono.git] / mcs / class / PEAPI / Metadata.cs
index a73122e410a47e35e81fac4765c79486503fa23f..e67f2966d2b307cdb5e6b33f20a174cc3128705d 100644 (file)
@@ -29,7 +29,7 @@ namespace PEAPI {
        /// <summary>
        /// Attributes for this assembly
        /// </summary>
-       public enum AssemAttr { EnableJITCompileTracking = 0x8000, 
+       public enum AssemAttr { Retargetable = 0x100, EnableJITCompileTracking = 0x8000, 
                DisableJITCompileOptimizer = 0x4000}
 
        /// <summary>
@@ -72,7 +72,7 @@ namespace PEAPI {
                Family, FamOrAssem, Public, Static = 0x0010, PublicStatic = 0x16, 
                Final = 0x0020, PublicStaticFinal = 0x36, Virtual = 0x0040, 
                PrivateVirtual, PublicVirtual = 0x0046, HideBySig = 0x0080, 
-               NewSlot = 0x0100, Abstract = 0x0400, SpecialName = 0x0800,
+               NewSlot = 0x0100, Strict = 0x200, Abstract = 0x0400, SpecialName = 0x0800,
                RTSpecialName = 0x1000, SpecialRTSpecialName = 0x1800, 
                HasSecurity = 0x4000, RequireSecObject = 0x8000}
 
@@ -4545,6 +4545,11 @@ namespace PEAPI {
                        tabIx = MDTable.AssemblyRef;
                }
 
+               public void AddAssemblyAttr (AssemAttr aa)
+               {
+                       flags |= (uint)aa;
+               }
+
                /// <summary>
                /// Add version information about this external assembly
                /// </summary>
@@ -4929,7 +4934,9 @@ namespace PEAPI {
                private static readonly uint max3BitSmlIx = 0x1FFF;
                private static readonly uint max5BitSmlIx = 0x7FF;
                // NOTE: version and stream name strings MUST always be quad padded
-#if NET_2_0 || BOOTSTRAP_NET_2_0
+#if NET_4_0
+               private static readonly string version = "v4.0.30319\0\0";
+#elif NET_2_0
                private static readonly string version = "v2.0.50727\0\0";
 #else
                private static readonly string version = "v1.1.4322\0\0\0";
@@ -5338,7 +5345,7 @@ namespace PEAPI {
                {
                        long startTilde = output.Seek(0,SeekOrigin.Current);
                        output.Write((uint)0); // Reserved
-#if NET_2_0 || BOOTSTRAP_NET_2_0
+#if NET_2_0
                        output.Write((byte)2); // MajorVersion
                        output.Write((byte)0); // MinorVersion
 #else
@@ -5393,7 +5400,7 @@ namespace PEAPI {
                        BuildTable(metaDataTables[(int)MDTable.TypeDef]);
                        BuildTable(metaDataTables[(int)MDTable.TypeSpec]);
                        BuildTable(metaDataTables[(int)MDTable.MemberRef]);
-#if NET_2_0 || BOOTSTRAP_NET_2_0
+#if NET_2_0
                        BuildTable(metaDataTables[(int)MDTable.GenericParam]);
                        BuildTable(metaDataTables[(int)MDTable.MethodSpec]);
                        BuildTable(metaDataTables[(int)MDTable.GenericParamConstraint]);
@@ -5442,7 +5449,7 @@ namespace PEAPI {
                        SortTable(metaDataTables[(int)MDTable.DeclSecurity]);
                        SortTable(metaDataTables[(int)MDTable.MethodSemantics]);
                        SortTable(metaDataTables[(int)MDTable.ImplMap]);
-#if NET_2_0 || BOOTSTRAP_NET_2_0
+#if NET_2_0
                        if (metaDataTables[(int)MDTable.GenericParam] != null) {
                                SortTable(metaDataTables[(int)MDTable.GenericParam]);
                                // Now add GenericParamConstraints