2010-02-03 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / class / PEAPI / Metadata.cs
index 2d92d9544260207f7cf1b734ec7dcb97128915cc..49ed4dc52331de7a14edb01a82f4c05dc2464089 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}
 
@@ -471,9 +471,14 @@ namespace PEAPI {
 
                internal sealed override void BuildTables(MetaData md) 
                {
+                       md.AddToTable(MDTable.CustomAttribute, this);
+                       if (byteVal == null) {
+                               valIx = 0;
+                               return;
+                       }
+
                        BinaryWriter bw = new BinaryWriter(new MemoryStream());
                        bw.Write(byteVal);
-                       md.AddToTable(MDTable.CustomAttribute, this);
                        MemoryStream str = (MemoryStream)bw.BaseStream;
                        valIx = md.AddToBlobHeap(str.ToArray());
                }
@@ -4540,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>