[linker] fix reading of symbols for assemblies loaded with -a
authorJb Evain <jbevain@gmail.com>
Thu, 20 Jan 2011 15:22:53 +0000 (16:22 +0100)
committerJb Evain <jbevain@gmail.com>
Thu, 20 Jan 2011 15:22:53 +0000 (16:22 +0100)
mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs
mcs/tools/linker/Mono.Linker/LinkContext.cs

index 9872cbeb1312568ee825c3814bd3c59654e6c016..e3ad96b410bf8cf324874466307965919e3ba050 100644 (file)
@@ -63,9 +63,21 @@ namespace Mono.Linker.Steps {
                        }
                }
 
+               static void SetAction (LinkContext context, AssemblyDefinition assembly, AssemblyAction action)
+               {
+                       TryReadSymbols (context, assembly);
+
+                       context.Annotations.SetAction (assembly, action);
+               }
+
+               static void TryReadSymbols (LinkContext context, AssemblyDefinition assembly)
+               {
+                       context.SafeReadSymbols (assembly);
+               }
+
                public static void ProcessLibrary (LinkContext context, AssemblyDefinition assembly)
                {
-                       context.Annotations.SetAction (assembly, AssemblyAction.Copy);
+                       SetAction (context, assembly, AssemblyAction.Copy);
 
                        foreach (TypeDefinition type in assembly.MainModule.Types)
                                MarkType (context, type);
@@ -86,7 +98,7 @@ namespace Mono.Linker.Steps {
 
                void ProcessExecutable (AssemblyDefinition assembly)
                {
-                       Annotations.SetAction (assembly, AssemblyAction.Link);
+                       SetAction (Context, assembly, AssemblyAction.Link);
 
                        Annotations.Mark (assembly.EntryPoint.DeclaringType);
                        MarkMethod (Context, assembly.EntryPoint, MethodAction.Parse);
index d5d41f044a7fb8cd3d0d0e602cf5284b4e135922..a9ce05fb3ce59213501da86162e154f1df559975 100644 (file)
@@ -146,7 +146,7 @@ namespace Mono.Linker {
                        return !_annotations.HasAction (assembly);
                }
 
-               void SafeReadSymbols (AssemblyDefinition assembly)
+               public void SafeReadSymbols (AssemblyDefinition assembly)
                {
                        try {
                                assembly.MainModule.ReadSymbols ();